The online racing simulator
Searching in All forums
(251 results)
HorsePower
S3 licensed
And one can clearly have fantastic and fair fights with Gentlefoot, as I have learned in the last OWRL race (that was really a thrilling one ).

So just go for R4R!

BTW, @Gentlefoot: We guys of °HoT are also around 30. A good age for simracing.
HorsePower
S3 licensed
Hey, this is not NFS, it's LFS.

So you cannot allways get the magic you might want. Setting up a car is often a question of balancing.

I'm not the king of setups, but for instance, if you want to have more grip, decrease tyre pressure. But then you won't be able to accelerate that fast, because more energy is lost by friction.

The bottom line for me is, making one thing better, makes another worse.

But sure, others can help in more detail here.
HorsePower
S3 licensed
To wrap this off-topic discussion up, I just want to say that everything is working fine now. Just as you guys here I have written some kind of SDK, basically a class covering some helpful functions for querying LFSW.

Furthermore I have written another class, called 'tracker', which uses the class above to get all HLs, PBs and WRs of a set of mates and stores them into a MySQL DB. There are some functions for a formatted output in a table.

The result can be seen here.

There are still some things to implement or some bug fixes to make, I guess.

Anyway, I will write a bit of documentation for all my stuff and release it on our homepage (or even somewhere here) in the near future. Maybe you guys are also interested in this tracker stuff.

Again, I want to thank you for the kind help here.

BTW: I don't want to compete with you guys. I believe your SDK is much more stable, bug free and runs on a wider range of platforms, since I really haven't cared much about compatibility and I'm not a PHP expert.
HorsePower
S3 licensed
I'm stunned. :Eyecrazy:

It works, basically with your function. But as hard as I try, I can see no difference (in principle) to my old code. The only change is that now there is this extra function that does the querying.

Maybe I just have overseen something.


<?php 
    
function get_lfsw_data($query_str) {
        
sleep(6);
        
$query "http://lfsworld.net/pubstat/get_stat2.php?version=1.3".$query_str."&c=2&idk=".$this->id_key;
        if (
$gzstr file_get_contents($query)) {
            if (
$str = @gzuncompress($gzstr)){
                return 
$str;
            }else{
                die(
$gzstr);
            }
        } else {
            return 
"";
        }
    }
?>

HorsePower
S3 licensed
Nope. How? And what's different there?

The only change I have to make is to remove the &c=2 and the gzuncompress stuff.
HorsePower
S3 licensed
EDIT: Solved. And really don't know how. Must have overseen a bug.

I think I found a strange thing, which I don't understand:

I'm programming a team tracker for my team, which means that I have to refresh all PB's and HL's of my mates every now and then.

Since I use the free pubstats, I have a certain sleep time between two queries.

Now my strange observations:
  1. If I use uncompressed LFSW output, everything works fine with 6 seconds intervals.
  2. If I use compressed output (tested &c=2 and $c=3), the first query works ok, while from the second query - no matter what interval I use (tested up to 120 seconds) - I get the "can't reload this page that quickly after another" error.
What's wrong here?
Last edited by HorsePower, .
HorsePower
S3 licensed
I found this post, http://www.lfsforum.net/showthread.php?p=68428#post68428

He can solve his problem by using the 5-second interval. Strange. 120 seconds don't work for me.

And I have no other processes grabbing LFSW. We have a homepage, which will query LFSW at maximum every 60 seconds, but only if someones klicking on it. And that are only up to 30 people per day. And this page uses a different ID-Key.

Anyway, thanks for you comments. This is off-topic here. If I can't solve the problem, I maybe post elsewhere.

EDIT: Yet a last note here: It works for uncompressed LFSW-output. Now I'm really confused.
Last edited by HorsePower, .
HorsePower
S3 licensed
Ok, implemented it. The error message I get is

"can't reload this page that quickly after another"

Is this a PHP problem, or a Apache problem (I'm using XAMPP at my localhost to test my work).

I mean, as far as I understood, I can use pubstat every 5 seconds. But also if I wait 10 seconds between queries I get this message every single time from the 2rd query in a row on.

EDIT: In fact, I get this error from the 2nd query on.

EDIT: And even with 120 seconds between queries. Must be a PHP/Apache problem, right?
Last edited by HorsePower, .
HorsePower
S3 licensed
Thanks very much! Will test that soon.
HorsePower
S3 licensed
Just a little question: Someone had this gzuncompress-error with an older version of LFSWorldSDK.


[B]Warning[/B]: gzuncompress(): data error in ...

ATM, I'm also programming a little script, and I also get this message from the 3rd time on I query LFSW (10 sec between queries).

I use this code (for example for WR's):

<?php 
gzuncompress
(file_get_contents("http://lfsworld.net/pubstat/get_stat2.php?version=1.3&action=wr&c=2&idk=".$this->id_key));
?>

How can I fix it? Any help appreciated! Thanks in advance!
HorsePower
S3 licensed
I just had a weird daydream ...

Is there anyone here who owns a gym and is willing to sell all the equipment and buy these things here (maybe 23 of them, one for each slot).

Mabye this could be called a LFS gym then. What a freakin' LAN party THAT would be ...
HorsePower
S3 licensed
Quote from Scawen :Gwendoline, I can't explain any more. I already went too far in that thread that took up my day on Saturday (the last link I posted in my previous post). It was too personal and emotional in fact, and I will avoid that in future.

Very wise decision! Being close to the community is a good thing and that's one thing that makes LFS really special. But like in every growing community, there are always some odd people ...

The dev's have a really strong support from the major part of us, giving bug reports and constructive criticism and improvement suggestions. But there are (and ever will be) of course people who are impatient and let it out.

And who of us isn't impatient? But we cannot change the way it is, and that's good. Because if the devs changed their way of doing what they do, LFS wouldn't just be what it is! Maybe all the unhappy and impatient folks should just take a timeout from LFS and play some Simbin stuff in the meantime.
HorsePower
S3 licensed
That's no bug. Read the threads in this section. There's an additional option to show or remove the messages and flags when SHIFT+F.
HorsePower
S3 licensed
A question here:

I extract host infos from the host list. I get everything right (cars, rules, qual mins, ...).

But reading the LAPS-Byte, I get 0 (=> practice) if no race is started (i.e. if the server is empty or people are in qualifying).

I thought the LAPS byte would just tell me, what the nr of laps in a (possible) race on this server is.

Take a look here to see the output of my server script.

Thanks for any help.
HorsePower
S3 licensed
And you may also like to check this new league of my mate Tongey from Sonic Realms Racing out.

http://www.sonicrealmsracing.co.uk/srcup.php

HorsePower
S3 licensed
Yeah! Finally!

Is it christmas already?

Thanks, Mr. CrazyICE. I'm sure it rocks. And I will test it tonight.
HorsePower
S3 licensed
I think I found the solution by myself. Trial and error helped me.

This is how I do it (the function argument $cars is equal to the string $tmp from the 1st post):


<?php 
    
function decode_cars($cars)
    {
        
$binarystring "";
        
// turn the character to an int and this into a binary string
        
$tmp decbin(ord($cars[3])); 
        
// add zeros in front of the string until it has 8 digits (because max value of byte is 255, i.e. 11111111)
        
while(strlen($tmp) < $tmp "0".$tmp
        
// the last byte will be the first 8 binary digits
        
$binarystring .= $tmp;
        
// and so on ...
        
$tmp decbin(ord($cars[2]));
        while(
strlen($tmp) < $tmp "0".$tmp;
        
$binarystring .= $tmp;
        
$tmp decbin(ord($cars[1]));
        while(
strlen($tmp) < $tmp "0".$tmp;
        
$binarystring .= $tmp;
        
$tmp decbin(ord($cars[0]));
        while(
strlen($tmp) < $tmp "0".$tmp;
        
$binarystring .= $tmp;
        
        
// just for debugging ...
        // echo "binary string = ".$binarystring."<br>";
        
        
$blen strlen($binarystring); // length of the binary string
        
$clen count($this->carlist); // number of cars in car list
        
$count 0;
        
$carnumber 0;
        
$allowedcars = array(); // init the array of allowed cars on the server
        
for($i=$blen-1$i>=0$i--){ // reverse parsing of the binary string
            
if ($binarystring[$i] == "1"){
                
$allowedcars[$count] = $this->carlist[$carnumber];
                
// just for debugging ...
                // echo "car = ".$this->carlist[$carnumber]."<br>";
                
$count++;
            }
            
$carnumber++;
        }
        
// return the array of allowed cars
        
return $allowedcars;
}
?>

The car list is defined by

<?php 
        $this
->carlist = array(    "XFG"
                                
"XRG",
                                
"XRT",
                                
"RB4",
                                
"FXO",
                                
"LX4",
                                
"LX6",
                                
"MRT",
                                
"UF1",
                                
"RAC",
                                
"FZ5",
                                
"FOX",
                                
"XFR",
                                
"UFR",
                                
"FO8",
                                
"FXR",
                                
"XRR",
                                
"FZR",
                                
"BF1"
                               
);
?>

Maybe this will help some of you guys, too!

Note that these variables and functions are part of a PHP class, that's why the pointer $this sometimes occur. In a standalone version just remove "$this->".
How can I read the Cars-Bytes
HorsePower
S3 licensed
I've searched this forum about this, but didn't find anything.

I'm writing some PHP stuff, trying to read all the information I can out of the host list. Everything works fine, but I have a problem, understanding the 4 bytes of Cars-Ulong variable.

This peace of code gets me the 4 bytes of the car information of a server:

<?php 
$tmp 
"";
for (
$w=0$w<4$w++) $tmp .= $this->HostList[$x++];
?>

Here, the host list has been retrieved in the usual way from LFSW and is stored in a huge string variable.

Now I have a string of 4 letters in $tmp. How can I convert this into a ULONG number?

I suppose, if I have the correct value as unsigned long int, I can convert it to a binary string by using

<?php 
$carsbinarystring 
decbin(carsulongvalue);
?>

Then I can parse the string for 0's and 1's to check, which cars are enabled on that server.

I would appreciate any help!

Thanks in advance,

HorsePower
HorsePower
S3 licensed
The bottom line is: What's going on here keeps Scawen from working on LFS because he has to read, clean up and post in this forum all day. Just let him do his job.
HorsePower
S3 licensed
I have a very tiny little request/improvement suggestion which should be able to get implemented very easily. That's why I'm posting it right here.

When connecting to a server by directly typing in the name, there's the name of the last server as a default, which is a nice feature.

However, often I want to change a name just slightly (changing a number for example, since we have many servers with different numbers in the end).

So when I use Backspace to erase and retype some things in the server name, the color automatically changes to default. It would be nice to change the color to the color of the last deleted character. That would mean much less clicking. And I noticed that - if the colors are wrong - the server cannot be found.

But clearly this is not a request with high priority. Sorry, if I bothered anyone.
HorsePower
S3 licensed
LOL ROFL.

Is there still the feature in Vista that you have to click the "Start"-Button to END your windows session?
HorsePower
S3 licensed
Quote from whitey6272 :does it matter?

Pointless thread?

Maybe pointless for you, but not for me. The reason why I was asking was, that we are deciding how to rename our servers. Shall we make it plain text, so that one can easily type it in directly? Or shall we use some useless, but characteristic letters in there?

So, I think the result of this vote is pretty clear to me: Most people use any kind of link or list to connect to a server, only a few people type in server names directly. So using some additional letters such as points, or brackets or whatever won't hurt.

But I will not use any of these new special characters, since they produce strange HTML-output when using LFSW scripts.

I'm thinking of the Redline Racing servers here, tbh. They have a fancy server name, but converting it to Join2LFS links always produces strange characters.


OFF-TOPIC: Is there an easy way to display the special characters on websites?
Last edited by HorsePower, .
HorsePower
S3 licensed
Yeah, I also think it could be a server issue. We had that with our servers a few times. A restart will usually help, but it could be also a hardware problem with the server.
HorsePower
S3 licensed
That's why I added "mainly" in the question of the vote.
FGED GREDG RDFGDR GSFDG