The online racing simulator
Searching in All forums
(986 results)
filur
S2 licensed
Quote from XCNuse :Maybe with this new button system you could have buttons to click, arrows to turn rotate drop etc.

It's pretty amazing that i didn't think of this myself.

Game has been updated with buttons for controls.
Insim Tetris
filur
S2 licensed
It had to be done.
Last edited by filur, .
filur
S2 licensed
I couldn't get a score since i don't have WMP10 or something, comparing some of the LFS-related result details:

Physics and 3D, 46.21fps vs 302.3fps
Graphics Memory, 191.53fps vs 1841.92fps

My "Invalid" results.

Intel C2D @ 3Ghz, Radeon X1950Pro
filur
S2 licensed

<?php 
require 'lfsworldsdk.php';
$SDK = new LFSWorldSDK('idkey goes here');

function 
some_function_name($SDK$track$car$racers) {
    
$chart $SDK->get_ch(array($track), array($car));
    
$ret   = array();
    
    foreach (
$chart[$track][$car] as $key => $item) {
        if (
in_array($item['racername'], $racers)) {
            
$ret[]  = $item;
            
$sort[] = $item['time'];
        }
    }
    
    
array_multisort($sortSORT_ASC$ret);
    return 
$ret;
}

$drivers = array('Megin',
                 
'Ondrejko',
                 
'dime_miki',
                 
'BenjiMC');

$table some_function_name($SDK621'XFR'$drivers);

foreach (
$table as $p => $driver)
    echo (
$p 1), '. '$driver['racername'], '<br />'PHP_EOL;
?>

filur
S2 licensed
I once upgraded from a Radeon 9550 to a GF6800, except for allowing higher resolutions and lots more AA/AF the new card didn't boost performance/fps at all. CPU was an Intel Celeron D @ 3Ghz.
filur
S2 licensed
Here's a relatively simple model for an InSim framework for PHP 5. This code only knows about 4 packets so it's far from being complete. Usage example at the bottom.


<?php 
php

    define
('ISP_ISI',        1);
    
define('ISP_VER',        2);
    
define('ISP_TINY',        3);
    
define('ISP_SMALL',        4);
    
    
define('ISP_MST',        13);
    
    
define('TINY_CLOSE',    2);
    
    interface 
SocketDriver {
        public function 
open($destination);
        public function 
send($data);
        public function 
receive();
    }
    
    class 
TCPDriver implements SocketDriver {
        protected 
$buffer;
        protected 
$socket;
        
        function 
open($dest) {
            if (
$this->socket stream_socket_client('tcp://'.$dest$errno$errstr5))
                
stream_set_blocking($this->socketFALSE);
            else
                throw new 
Exception('no dice');
        }
        
        function 
send($data) {
            
fwrite($this->socket$data);
        }
        
        function 
receive() {
            if (
$data fread($this->socket1024)) {
                
$this->buffer .= $data;
                
$packets = array();
                
                while (
1) {
                    if (
strlen($this->buffer) < 4)
                        break;
                    
                    
$size array_shift(unpack('C'substr($this->buffer01)));
                    
                    if (
strlen($this->buffer) >= $size) {
                        
$packet substr($this->buffer0$size);
                        
$packets[] = $packet;
                        
                        
$this->buffer substr($this->buffer$size);
                        
                    }
                    else break;
                }
                
                return 
$packets;
            }
            
            return 
FALSE;
        }
    }
    
    abstract class 
ISP_Pack {
        static 
$ISP_TINY = array('C''C''C''C');
        static 
$ISP_ISI = array('C''C''C''C''v''v''C''C''v''a16''a16');
        static 
$ISP_MST = array('C''C''C''C''a64');
    }
    
    abstract class 
ISP_Unpack {
        static 
$ISP_VER 'CSize/CType/CReqI/CZero/a8Version/a6Product/vInSimVer';
    }
    
    class 
IS_Packet {
        static 
$socketdriver;
        
        static function 
bindSocketDriver(SocketDriver $driver) {
            
self::$socketdriver $driver;
        }
        
        function 
__set($v$l) { throw new Exception('no such field'); }
        function 
__get($v) { throw new Exception('no such field'); }
        
        function 
pack() {
            
$stack = eval('return ISP_Pack::$'.get_class($this).';');
            
            foreach (
$this as $item)
                
$packed .= pack(array_shift($stack), $item);
            
            return 
$packed;
        }
        
        static function 
unpack($data) {
            
$type array_shift(unpack('C'substr($data11)));
            
            switch (
$type) {
                case 
ISP_TINY:
                case 
ISP_SMALL:
                    
$subtype array_shift(unpack('C'substr($data31)));
                    
# switch ($subtype) ..
                    
break;
                
                case 
ISP_VER:
                    
$packet = new ISP_VER;
                    break;
                
                default:
                    return 
FALSE;
            }
            
            
$data unpack(eval('return ISP_Unpack::$'.get_class($packet).';'), $data);
            
            foreach (
$data as $var => $value)
                
$packet->{$var} = $value;
            
            return 
$packet;
        }
        
        function 
send() {
            
self::$socketdriver->send($this->pack());
        }
    }
    
    class 
ISP_ISI extends IS_Packet {
        var 
$Size 44;
        var 
$Type ISP_ISI;
        var 
$ReqI;
        var 
$Zero;
        var 
$UDPPort;
        var 
$Flags;
        var 
$Sp0;
        var 
$Prefix;
        var 
$Interval;
        var 
$Admin;
        var 
$IName;
    }
    
    class 
ISP_TINY extends IS_Packet {
        var 
$Size 4;
        var 
$Type ISP_TINY;
        var 
$ReqI;
        var 
$SubT;
    }
    
    class 
ISP_VER extends IS_Packet {
        var 
$Size;
        var 
$Type;
        var 
$ReqI;
        var 
$Zero;
        var 
$Version;
        var 
$Product;
        var 
$InSimVer;
    }
    
    class 
ISP_MST extends IS_Packet {
        var 
$Size 68;
        var 
$Type ISP_MST;
        var 
$ReqI;
        var 
$Zero;
        var 
$Msg;
    }
    
    
$mySocket = new TCPDriver;
    
$mySocket->open('127.0.0.1:29999');
    
    
IS_Packet::BindSocketDriver($mySocket);
    
    
$ISI = new ISP_ISI;
    
$ISI->ReqI 1;
    
$ISI->Admin 'password';
    
$ISI->IName 'PHP 5';
    
    
$ISI->send();
    
    while (
1) {
        
        if (
$packets $mySocket->Receive()) {
            foreach (
$packets as $packet) {
                
$packet IS_Packet::unpack($packet);
                
                if (
$packet instanceof ISP_VER) {
                    echo 
'Connected to LFS '$packet->Product' '$packet->Version' / InSim v'$packet->InSimVerPHP_EOL;
                    
                    
$MST = new ISP_MST;
                    
$MST->Msg 'Hello, World!';
                    
                    
$MST->send();
                    
                    
sleep(1);
                    
                    
$InSimClose = new ISP_TINY;
                    
$InSimClose->SubT TINY_CLOSE;
                    
$InSimClose->send();
                    
                    exit();
                }
            }
        }
        
        
sleep(1);
    }
?>

filur
S2 licensed
Quote from chucknorris :Today, its nearly impossible to connect via java to lfs. And i assume its quite impossible for the most scripting languages.

Sorry, but this is simply not true. I believe there's an InSim library for Java (jInSim), and i'm having no issues at all working with InSim thru PHP and Ruby.
filur
S2 licensed
Quote from Signature Editor :Allow [IMG] Code No
Can Upload Images for Signature No
Can Upload Animated GIF for Signature No

:ouch:
filur
S2 licensed
"Plate" is your number plate, once you're registered and logged in you'll find "Send Hotlap" in the menu.
filur
S2 licensed
"ISP_ISI" should not go in the packet, you're supposed to send the value of the constant ISP_ISI.


<?php 
define
('ISP_ISI'1);        //  1 - instruction        : insim initialise
?>

filur
S2 licensed
:birthday: :grouphug: :birthday:
filur
S2 licensed
http://ati.com/

Drivers & Software, pick your OS, "Radeon 9800 Series"
filur
S2 licensed
It's a pretty decent graphics demo, damage looks nice.
filur
S2 licensed
Quote from X tempor :"Extract archive to arbitrary directory."

Extract:
To extract is to return a compressed file to its original state. Typically in order to view the contents of a compressed file, you must extract it first.

Archive:
A group of files compressed into a single file, which is then used for storage or transfer.

Arbitrary:
Based on or subject to individual discretion or preference.

Directory:
In computing, a directory, catalog, or folder, is an entity in a file system which contains a group of files and other directories.

In short, unzip the files to wherever you want them.
filur
S2 licensed
If you're running a dedicated host, make sure you're not trying to load layout files located at your LFS client, the layouts need to be located in the data directory of the server.
filur
S2 licensed
Waiting for patch X, i guess.
filur
S2 licensed
If your system has enough resources to be useful for anything these days, it will be able to run an LFS demo server.
filur
S2 licensed
RAM usage: very low.
CPU usage: very low.
Bandwidth usage: 40 - 80kbyte/s depending on PPS.

http://en.lfsmanual.net/wiki/Hosting#Bandwidth_Calculations
filur
S2 licensed
Quote from Dygear :I did not need anything that insane.


<?php 
function recursive($path) {
    
$iit = new RecursiveIteratorIterator($it = new RecursiveDirectoryIterator($path));
    foreach (
$iit as $file) {
        echo 
$file->getPath() . $file->getFilename() . PHP_EOL;
    }
}
?>

filur
S2 licensed
Quote from rheiser :Now if the idea was to make an XML schema that held generic race data, that gets more interesting.

It would probably be quite simple to convert an LFS-specific format into what you have in mind.
filur
S2 licensed
Quote from MoHaX :python

Fails on forced indentation of code.

Dygear, check out RecursiveIterator and RecursiveDirectoryIterator in SPL.
filur
S2 licensed
I'd love this update.
FGED GREDG RDFGDR GSFDG