The online racing simulator
Searching in All forums
(986 results)
filur
S2 licensed
<?php include 'path/to/file.php'; ?>

http://google.com/search?q=embed+php
filur
S2 licensed
http://www.php.net/get/php-5.2.5-Win32.zip/from/a/mirror

scriptfile.php

<?php 
php

foreach (glob('*.' .$argv[1]) as $file) {
    if (
FALSE !== filesize($file) && filesize($file) < $argv[2]) {
        
unlink($file);
    }
}


?>

batchfile.cmd

cd x:\path\to\pictures
x:\path\to\php.exe -f "x:\path\to\scriptfile.php" jpg 8192

filur
S2 licensed
This might work, not tested much.


<?php 
// windows systemtimeasfiletime to unix timestamp
// wstft_to_unixtime(byte[8])
function wstft_to_unixtime($bytes)
{
    
$time_hi array_shift// grab first element of array returned by unpack
        
unpack('I'substr($bytes4)) // skip first 4 bytes, unpack last 4 bytes as unsigned integer
    
);
    
    
// $time_hi is now equal to the original 64-bit integer bitshifted 32 steps to the right (/= 2^32)
    // 100ns * (2^32) = 429.4967296 seconds
    // thus $time_hi now consists of the number of 429.4967296-second intervals between 1601 and 1970
    
    // there are 116444736000000000 100-nanosecond intervals between jan1 1601 and jan1 1970
    
    
$time_hi -= 27111902.8// remove 1601-1970 time difference (also shifted 32 steps to the right)
    
$time_hi *= 429.4967296// turn into seconds
    
    
return $time_hi;
}
?>

*Edit: didn't know bcmath was bundled with php, the above would only be useful if you for some reason don't have bcmath.
Last edited by filur, .
InSim, IS_PSF.STime odd after driver switch
filur
S2 licensed
When/after doing a driver switch, the time reported in IS_PSF.STime appears to be wrong. It seems to only report the time taken from the swap (from when the new driver gets in the car) until the new driver drives off, discarding the time taken while the old driver was still in the car (all pit work done, etc.).

Tested with X38 on X30 dedi (and X10 on X10 dedi).
filur
S2 licensed
struct IS_MSO // MSg Out - system messages and user messages
{
byte Size; // 136
byte Type; // ISP_MSO
byte ReqI; // 0
byte Zero;

byte UCID; // connection's unique id (0 = host)
byte PLID; // player's unique id (if zero, use UCID)
byte UserType; // set if typed by a user (see User Values below)
[B]byte TextStart; // first character of the actual text (after player name)[/B]

char Msg[128];
};

substr(MSO.Msg, MSO.TextStart);

filur
S2 licensed
this suggestion has entered the garbage bin in a spectacular fashion.
filur
S2 licensed
Quote from St4Lk3R :... our own physics engine in via InSim.

filur
S2 licensed

<?php 
echo mysql_fetch_object(mysql_query($sql))->total;
?>

filur
S2 licensed
filur
S2 licensed
Added a few bits to Bejeweled.
filur
S2 licensed
:icon23:
filur
S2 licensed
The first byte in your packet is the ASCII character "I". There is no "ISI\0" string in this packet, ISP_ISI is an integer constant. Make sure you've got the latest edition of docs/InSim.txt
filur
S2 licensed
C#-style delegates, just for fun.
Last edited by filur, .
filur
S2 licensed
Quote from Dalek0220 : Still, if you realize that most skins are at 2048x2048, and were saved as a .png, instead of .jpg, the size would be bigger. When saved at 512x512, .png's size will be smaller. Makes sense?

If you realize that a 2048x2048 image consists of 4x4 512 pixel squares, it doesn't make alot of sense.
filur
S2 licensed
see:
JPG (212kb) vs PNG (1278kb)

http://www.google.com/search?q=1278/212
filur
S2 licensed
Nice movie, Jens.
filur
S2 licensed
Quote from Hollywood :PHP is a bad choice for InSim apps due to the nature of the fact its a web scripting language

Quote from epp_b :If your goal is to make local applications for LFS, PHP makes no sense. It is a web programming language.

Quote from xaotik :any scripting language made for web applications is out of the question.

Disregarding libraries, only looking at language features, running PHP as you would often run other popular scripting languages such as Python or Ruby (using the standalone interpreter), what makes PHP a web-only language?
filur
S2 licensed
:shhh:
filur
S2 licensed
Try this.


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

function 
some_function_name($SDK$racers) {
    static 
$charts = array();
    
$ret $sort = array();
    
    foreach (
$racers as $racername => $combo) {
        
$c = &$charts[$combo['track']][$combo['car']];
        
        if (
FALSE == isset($c)) {
            
sleep(5);
            
$c $SDK->get_ch(array($combo['track']), array($combo['car']));
        }
        
        foreach (
$c[$combo['track']][$combo['car']] as $key => $item) {
            if (
$item['racername'] == $racername) {
                
$ret[]  = array_merge($item$combo);
                
$sort[] = $item['time'];
            }
        }
    }
    
    
array_multisort($sortSORT_ASC$ret);
    return 
$ret;
}

function 
disptime($t) {
    return 
date('i:s', ((int) $t 1000)) . '.' $t 1000;
}

$drivers = array
(
    
'Atti Honyi (SK)'    => array('track' => '000''car' => 'FXO'),
    
'Megin'                => array('track' => '000''car' => 'FXO'),
    
'Sisolak'            => array('track' => '000''car' => 'RB4'),
    
'eraser_svk'        => array('track' => '000''car' => 'RB4'),
    
'Ghost_CZ'            => array('track' => '000''car' => 'XRT'),
    
'BIGMAN'            => array('track' => '000''car' => 'XRT')
);

$table some_function_name($SDK$drivers);

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

filur
S2 licensed
I've got an old cat.
FGED GREDG RDFGDR GSFDG