PDA

View Full Version : How to retrieve LFS World stats?


Pages : 1 [2]

EQ Worry
5th March 2009, 21:11
In that case, well, no comment, just: :thumb: :thumb: :thumb:

joshdifabio
6th March 2009, 11:28
Are the new tarpits implemented by ident-key or by user id?

EQ Worry
6th March 2009, 11:30
My experiments show it is tarpitted by username (account). Even if you generate three keys and use them one after another you must observe the 5 seconds delay rule.

joshdifabio
6th March 2009, 11:30
Okay, thanks :).

Dygear
6th March 2009, 13:42
(Ironic - 'Short' has more chars in it then 'Long', at least 'verbose' lives up to it's name on a char length stand point.)
Short explanation: It's tied to the account, not the key.
Long explanation: It's tied to the users account, where the key acts as a symbolic link to the account, working effectively as an alias for the users account.

joshdifabio
7th March 2009, 00:17
Is the 'teams' function broken at the moment?

Try this: http://www.lfsworld.net/pubstat/get_stat2.php?version=1.4&idk={identKey}&ps=false&action=teams&c=0&s=0

Edit: I started getting unexpected output around 2 weeks ago (February 24th), but that could be at my end as I made some changes to my system around that time.

Victor
7th March 2009, 00:41
works again.

about unexpected results, I'm doing a big teams cleanup, so there are atm around 200 less entries than before. Dunno if that's what you meant (getting less entries)

joshdifabio
7th March 2009, 00:55
works again.

about unexpected results, I'm doing a big teams cleanup, so there are atm around 200 less entries than before. Dunno if that's what you meant (getting less entries)
Oh yes! I just came to post to say that lots of teams have disappeared!

What's the reason for the clean-up just out of interest? Is it due to people deleting their teams from LFSWorld or what?

Edit: Members of the deleted teams still have the tag shown on their profile page, just fyi.

Victor
7th March 2009, 10:46
The reason is people NOT deleting their team entry when they quit.
And I could've sworn I'm also deleting the tags - grrr

joshdifabio
7th March 2009, 12:15
Could you let us know when you've finished? Our site keeps claiming that everyone's left the team :P. (And actually that almost every team has ceased to exist.)

Victor
7th March 2009, 12:31
shouldn't be long - I've gone through the oldest entries first, so there were the most to delete. I've still a couple hundred to go. But there are still 846 teams in the database atm, so they can't all have ceased to exist :)

EDIT - 831 teams - i think i'm done, though you should always expect teams to disappear coz I'll be doing this from time to time.

joshdifabio
7th March 2009, 13:29
shouldn't be long - I've gone through the oldest entries first, so there were the most to delete. I've still a couple hundred to go. But there are still 846 teams in the database atm, so they can't all have ceased to exist :)

EDIT - 831 teams - i think i'm done, though you should always expect teams to disappear coz I'll be doing this from time to time.
Well if they're gone from LFS World then that should sync up on my site, which is fine, but earlier on I wasn't getting any drivers for spdoRacing, SK, F1RST, #low or any of the teams I tried, even though they're still listed on LFS World.

I'll try again now and report my results...

Edit: Working fine now :)

HorsePower
7th March 2009, 14:08
To be honest, I'm not amused. :arge:

Victor, how did you decide on which teams to delete?

I know of 3 teams that have mistakenly been deleted (because they have active team members).

My own team including ...


Hell on Tyres (ID 137)
Rising Suns Motorsport (ID 509)
Majestic Dragon Drivers (ID 478)

I was the one with administration rights for Hell on Tyres.

Please bring them back to life again!

Kind regards and many thanks,

Timo

Victor
7th March 2009, 17:43
If a team can't even keep their URL working, it's not worth being on the teams list. So I've removed about all of those teams whole URL failed in any way.
Feel bad about that? Just keep your entry current and it won't be deleted. Quite simple.

HorsePower
7th March 2009, 18:09
Well, the URL (the one that can be found in my sig) in fact worked until a few days ago, when the team hosting organization (the german gamers club) changed it's servers.

Believe it or not, it was just today that I learned that the URL was not reachable anymore. (Because I already assumed that you had used this as selection criterion).

So apart from the coincidence factor which comes in here I really do not see why a wrong URL is a reason to delete a whole team entry in LFS World. What about teams not even having any URL?

I think the activity of the the official members of a team is a criterion which is much more significant.

And even then, when it is found that all members of an existing team had been inactive for a while, it would be good idea to contact the team administrator before deleting a team.

If you get no answer of the adminstrator in a short time, it might be justified to delete a team.

Of course this is not as easy as looking at a URL, but I wonder how many other racers out there will find their team being deleted.

At least I would have appreciated some kind of announcement from your side, so that people have the chance to check their URL.

As for Rising Suns Motorsport, their homepage has been hosted by a free-of-charge provider which seems to be down meanwhile. The responsible person is inactive since a year, but many team members are still active but do not have sufficient knowledge or permissions to handle the situation immediately.

So all this seems to tell me: Life isn't always as easy as looking at a URL and concluding that a team is no longer existing if the URL is invalid.

I appreciate your work Victor and I'm trying not to be too offensive here. But I had to say these things and I hope you understand my point.

Yours sincerely,

Timo

Victor
7th March 2009, 18:17
I guess you were unlucky then. Statistically I could have known that of the 200+ entries I would be deleting some false positives, but frankly you cannot expect me to mail over 1000 teams and strike off all the ones that reply.
The next cleanups will be based on both url-validity and last-activity, as I'm now recording last-activity-time as well. So that should be more precise.

Also I can't be bothered at all by people 'not knowing how to administer the team-entry on lfsworld'. Ignorance is not an excuse. If they have a question about something, they can simply ask me and I will answer.

Just apply for the team to get it listed again in your case and then add the members again.

Victor
7th March 2009, 19:36
You'll need to register the team again. I won't be adding any back automatically.

HorsePower
7th March 2009, 19:42
Thank you for your understanding, Victor.

Clearly, writing a message to 1000+ people (and getting a few hundred answers in return and checking them all) is a huge task and I can understand that this might not be an option.

So I'm now happy when you will consider activity as well in the future. And if the process of team clean-up is on-going you might also be able to send a few messages - not requesting an answer but simple a note that says something like "Hey your URL is wrong and/or your team members are inactive for several weeks now. Be aware that your team will be deleted by ... if until that point in time your URL is still invalid and no member are active in the mean time".

Nevertheless I would also have appreciated a forum announcement regarding the mass-deletion of teams.

So, I will now register the team again ... file closed as far as I'm concerned.

Kind regards,

Timo

EDIT: Registration has been send.

Dygear
8th March 2009, 17:50
For each member in the team (&TEAM) list, find last activity time (&PST) of that member. If grater then 6 months, for each member, inform the teams admin by auto email. Use IMAP to check if you have gotten a reply from the registered email from the teams admin, you can even read the contents of the message and make a choice based on that.

Message to send team admin:
Your team appears to be inactive. Please reply back with a 'Active' if your team is still active, or 'Inactive' if your team is still inactive. If you fail to respond from this E-Mail address within 4 weeks (28 days) your team will be deleted. Optionally you can send an email to teams@lfs.net for support if your team is active but you no longer have rights over the email account.

I would also recommend showing the 'up for deletion' status on the LFSWorld website, with a link to email teams@lfs.net.

d_cury
19th April 2009, 10:58
Sorry but my english its too poor
I wish show this trick in my team blog (www.satteam.blogspot.com) but dont understand de explanation.
If possible victor or any who know this gadget explain to me how place in my blog.
Again sorry my english

Drift King CZ
27th April 2009, 15:03
$cachestat = @stat('cache.txt');
$now = date('YmdHis');
$file = date('YmdHis', $cachestat[9]);

echo $now-$file;

if(($now-$file) > 6) {

This means that it will do something if the file cache.txt is older than 6 seconds. The "something" is it will do a lfsw request with my IDK... Victor, you said, that there is 1 request per 5 seconds allowed. Why was my IDK banned for 15 minutes then? I don't understand :shrug:.

EDIT: Hmm, now I see it aren't seconds. I printed it on screen and it wasn't realistic. After about 1 minute later I tried to reload it and it outputed about 4100 seconds, which is stupid. What is it then, if not seconds? Milliseconds?

Victor
27th April 2009, 15:18
EDIT: Hmm, now I see it aren't seconds. I printed it on screen and it wasn't realistic. After about 1 minute later I tried to reload it and it outputed about 4100 seconds, which is stupid. What is it then, if not seconds? Milliseconds?

I used to make the same mistake by not explaining what 'it' is. It's best to not use the word 'it' so much, but replace 'it' with what you actually mean. Because atm I don't know what you mean.
The tar pit works as expected. One request per 5 seconds is allowed. You can easily test that by doing a manual request to pubstat in your browser and reload it once per second. You'll see a result is only returned once every 5 refreshes (once per 5 seconds).

My suggestion is to check your stat function and if it returns values you're expecting.

Drift King CZ
27th April 2009, 15:42
Ah, sorry. I meant output of $now-$file in the script. But now I found that it really outputs seconds, so I don't know :/.
EDIT: Yes, you were right. Everything is ok, + there is something in the script that it won't find sometimes server name so it will show off it's offline. Will contact the creator.

Dygear
30th April 2009, 13:07
$cachestat = @stat('cache.txt');
$now = time();
$file = date('U', $cachestat[9]);

echo $now - $file;

if (($now - $file) > 6) {

}

The format character 'U' of the date() (http://www.php.net/manual/en/function.date.php) function returns, Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT), also see the time() (http://www.php.net/manual/en/function.time.php) function.

Drift King CZ
30th April 2009, 13:19
Yes, I already found this. But there still something has to be in the whole script, because I have no idea why it outputed that the server is offline.

Dygear
30th April 2009, 13:37
Yes, I already found this.

And yet you did not post the answer you found.

Drift King CZ
30th April 2009, 21:36
Yes, sorry. But I was still confused even after I found the answer. I thought that it are not seconds, because the script caused the problem again.

I tried to contact the creator, but unfortunately VorTeX3k isn't answering on ICQ, although he authorized me.

But thanks anyway.

nesrulz
2nd July 2009, 18:32
Hi,

How I can put this on my html page?

http://www.lfsworld.net/hoststatus/?h=MaksNet+%26+SERT+DEMO+1

Thx. :shy:

EDIT: done, thx vicc. ;)

paXton
14th August 2009, 02:21
Hi,

is there a way to find out via php, if a host is connected to the insim relay and viewable via LFS Remote?
In "getstat2.php?action=hosts" I doesn't find such info.

My intention is to display a host list with a link to lfs remote only where it is accessable.


thx in advance,
paXton

morpha
14th August 2009, 02:47
Hi,

is there a way to find out via php, if a host is connected to the insim relay and viewable via LFS Remote?
In "getstat2.php?action=hosts" I doesn't find such info.

My intention is to display a host list with a link to lfs remote only where it is accessable.


thx in advance,
paXton

Obtain a list of hosts from the InSim Relay (http://en.lfsmanual.net/wiki/InSim_Relay#Connecting_to_the_InSim_Relay) :nod:

Dygear
14th August 2009, 12:12
Obtain a list of hosts from the InSim Relay (http://en.lfsmanual.net/wiki/InSim_Relay#Connecting_to_the_InSim_Relay) :nod:

As that is phesdo query-able, I'll add it to LFS World SDK as a method.

michele0676
24th August 2009, 07:31
I need help guys.
Using "pst" action i receive:
157663430
4767155
33346
2045
506
468
363
2835
235
45
44
17
Italy
0
^1R^7eady^32^1R^7oll GT2 Racing
1251054488
631
FXR


There is a way to retrieve this only one ?
^1R^7eady^32^1R^7oll GT2 Racing

elkdanger
24th August 2009, 08:11
I need help guys.
Using "pst" action i receive:
157663430
4767155
33346
2045
506
468
363
2835
235
45
44
17
Italy
0
^1R^7eady^32^1R^7oll GT2 Racing
1251054488
631
FXR


There is a way to retrieve this only one ?
^1R^7eady^32^1R^7oll GT2 Racing

Not on it's own, no - you'll have to parse that response from LFS World to retrieve only the content that you need. All those elements are separated by line breaks I believe, so it should be a simple case of just splitting it into an array then indexing the element that contains the server name. If you let us know which language you're using, I'm sure someone here can help you out with some code.

EQ Worry
24th August 2009, 08:13
Well, I would split the output by new line character and take 15th item. In C# it may basically look like this (I hope I don't have a bug there :)):

string host = pst.Split('\n')[14];

michele0676
24th August 2009, 08:22
Well, I would split the output by new line character and take 15th item. In C# it may basically look like this (I hope I don't have a bug there :)):

string host = pst.Split('\n')[14];

I did the same in php but there is a problem.
I cannot read, for example, 3 times in 1 sec the same script ...

EQ Worry
24th August 2009, 08:27
Yes, if using the LFSW data for free, you are limited to one request per 5 seconds, only then you can receive another set of data. The option is either to use the service as paid one or implement a buffer/queue that would allow sending requests only after 5 seconds.

Dygear
26th August 2009, 07:14
Well, I would split the output by new line character and take 15th item. In C# it may basically look like this (I hope I don't have a bug there :)):

string host = pst.Split('\n')[14];

I did the same in php but there is a problem.
I cannot read, for example, 3 times in 1 sec the same script ...

I would like to point out that the split (http://php.net/manual/en/function.split.php) function in PHP is deprecated as of PHP 5.3.0, and should no longer be used. It would be better to use the php function explode (http://php.net/manual/en/function.explode.php), as that seems to not be going anywhere, and has a long standing counterpart, implode (http://php.net/manual/en/function.implode.php).

array explode(string $delimiter, string $string[, int $limit])

// Yes, I know this is giving a man a fish.
$host = "{$explode("\n", $string)[14]}"

michele0676
26th August 2009, 11:29
@Dygear :smileypul

Flame CZE
26th August 2009, 12:10
// Yes, I know this is giving a man a fish.
$host = "{$explode("\n", $string)[14]}"

Shouldn't it be like this ?
$host = explode("\n", $string, 14)

Dygear
27th August 2009, 06:27
Shouldn't it be like this ?
$host = explode("\n", $string, 14)

What I posted is the same as doing this:
$array = explode("\n", $string);
$host = $array[14];
But my solution does that in one line :)

Victor
23rd September 2009, 05:13
This is a message for those of you who collect racer's countries via the pubstats.

I have updated the country listing that our websites use to be more like the ISO 3166-1 (http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm) one. More like and not exactly because we don't use only capitals. And there are some added names in our list (england, scotland, etc and kosovo).

But this means that some stored country names have changes as of now. For example 'Slovak Republic' is now 'Slovakia' and 'Russia' is now 'Russian Federation'.
If you store countries, you may have to check their names against the iso list and update them accordingly. Or if for example you display flags you may have to rename some flag files. Most names will have stayed the same though. It's mostly the more exotic names that are slightly different.

I'll attach a php file with the exact array that we use (and a small array with some additional names, not in the ISO list), if that will help a bit.

joshdifabio
23rd September 2009, 11:42
This is a message for those of you who collect racer's countries via the pubstats.

I have updated the country listing that our websites use to be more like the ISO 3166-1 (http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm) one. More like and not exactly because we don't use only capitals. And there are some added names in our list (england, scotland, etc and kosovo).

But this means that some stored country names have changes as of now. For example 'Slovak Republic' is now 'Slovakia' and 'Russia' is now 'Russian Federation'.
If you store countries, you may have to check their names against the iso list and update them accordingly. Or if for example you display flags you may have to rename some flag files. Most names will have stayed the same though. It's mostly the more exotic names that are slightly different.

I'll attach a php file with the exact array that we use (and a small array with some additional names, not in the ISO list), if that will help a bit.
Thanks for the update Victor.

Is there any reason why some countries, e.g. COCOS (KEELING) ISLAND, SAINT BARTHÉLEMY have been ignored?

Edit: Also, would it be possible for you to generate empty .txt highlight files for countries which don't yet have any highlights? It would simplify and improve the effectiveness of my code a great deal. Currently, 404'ing on any non-existant highlight files causes quite large delays in my script due to the timeout period.

Flame CZE
23rd September 2009, 12:05
Just a question, won't it show an error when there's a comma after the last member of an array, like in the two in the file?
$ExtraCountriesLFS = array (
'England',
'Northern Ireland',
'Scotland',
'Wales',
'Kosovo',
);

Victor
23rd September 2009, 15:22
Thanks for the update Victor.

Is there any reason why some countries, e.g. COCOS (KEELING) ISLAND, SAINT BARTHÉLEMY have been ignored?

Edit: Also, would it be possible for you to generate empty .txt highlight files for countries which don't yet have any highlights? It would simplify and improve the effectiveness of my code a great deal. Currently, 404'ing on any non-existant highlight files causes quite large delays in my script due to the timeout period.
I may have left those two out by accident. EDIT - ohyeah countries do need to have people living in them and have internet to be listed by us :D
I'll have a look at touching non-existent files soon.
Just a question, won't it show an error when there's a comma after the last member of an array, like in the two in the file?
$ExtraCountriesLFS = array (
'England',
'Northern Ireland',
'Scotland',
'Wales',
'Kosovo',
);
Nope, in arrays that last comma is ok :)

Victor
23rd September 2009, 17:46
I have updated the php file attached to the earlier post. That list is final I think.

There are a number of LFS accounts that still have a name not in that list, but that's because I don't know what to do with them.
For example there are some accounts with Yugoslavia. I don't know what to convert that into because there is more than 1 possibility. The same with "Serbia and Montenegro" as they are split now.
So I will leave such countries for now and let the user decide for himself the next time he updates his account details (then he's forced to update it).

Also keep in mind there is the 'Other' option and some really old accounts may have no country at all because of programming noobness on my end back then, but pretty much none of those accounts are used anymore.

Also I've created empty highlights files for every country that didn't have one yet.

Krayy
13th October 2009, 21:03
Is there any way currently of determining what team a racer belongs to, or more importantly, can it be added to the pst request output for the next version?

Victor
14th October 2009, 16:23
atm you can use the teams action to get the entire teams list. Hmm I could improve that though.
I'll think about the pst option.

Krayy
14th October 2009, 19:01
atm you can use the teams action to get the entire teams list. Hmm I could improve that though.
I'll think about the pst option.
Hi Victor,

Thanks for considering this. I had contemplated getting the whole team info, but that is a LOT of data to request from the stats site as well as parse.

Ant0niS
3rd November 2009, 13:25
can I retrieve hotlaps filtered by country, like you can do through LFSworld?

e.g. all hotlaps at BL1 with XRG by Greek drivers?

Thank you in advance and i hope you make sense what i mean

Victor
3rd November 2009, 16:09
at this time there is no pubstat hotlaps country filter. I could add it for a next version, but that probably won't be very soon.

Ant0niS
3rd November 2009, 16:36
at this time there is no pubstat hotlaps country filter. I could add it for a next version, but that probably won't be very soon.

Thank you for the reply :)

--==Gogo==--
8th November 2009, 07:47
Hi Victor,

for a few days now the "?action=hosts" command sends a wrong version-flag in TMLT. For example "oelfsm@liwest.at" has a "1" in Type which stands for new S1 but I am quite sure this is a S2-Sever. And there are quite a few more servers where this happens.

Maybe you can have a look.
Thank you.

SumBeam
8th November 2009, 14:24
Hi Victor,

for a few days now the "?action=hosts" command sends a wrong version-flag in TMLT. For example "oelfsm@liwest.at" has a "1" in Type which stands for new S1 but I am quite sure this is a S2-Sever. And there are quite a few more servers where this happens.

Maybe you can have a look.
Thank you.


That's not a fault of that command, but thats because the server running S1 content. The cars which used, are RB4, FXO and the XRT, that is S1 content. The track (South City) is also S1 content. It doesn't matter if it is a S2 server, but LFS World and LFS looking at the track/car combo if it is Demo/S1/S2.

--==Gogo==--
8th November 2009, 14:31
Ah, thank you. Didn't know that.

morpha
8th November 2009, 15:22
But with 46 max connections it should still be S2, unless they dropped the max conns limit for S1 :shrug:

joshdifabio
8th November 2009, 15:35
But with 46 max connections it should still be S2, unless they dropped the max conns limit for S1 :shrug:

The only difference between S1 and S2 is the content (cars & tracks).

morpha
8th November 2009, 17:27
The only difference between S1 and S2 is the content (cars & tracks).

Good to know, for some reason I thought S1 was limited to 24 connections or something like that :tilt:

dmartin
27th January 2010, 15:51
Hi,
How do I get online at: info
Wanna make gadget for team that will show at which server are team mates
if they are online of course :)

morpha
27th January 2010, 15:57
That would be http://www.lfsworld.net/athost.LICENCENAME
For example, http://www.lfsworld.net/athost.morpha

dmartin
27th January 2010, 16:54
ok,THX for that,but can you help me with code for html pls

Flame CZE
27th January 2010, 16:56
<img src="http://www.lfsworld.net/athost.username" alt="Status">

dmartin
27th January 2010, 17:05
<img src="http://www.lfsworld.net/athost.username" alt="Status">

THX but its not working:shrug:

morpha
27th January 2010, 17:16
That's because athost displays the hostname as string, not as image. What you're trying to do requires javascript. An inline frame would work too, but it'd probably ruin your layout.

dmartin
27th January 2010, 17:21
Yes i did try with inline frame,but then it shows like this:
^4(^3IHR^4)^4IRONHORSE RACING

and should be like this:
(IHR)IRONHORSE RACING

morpha
27th January 2010, 17:37
Yes i did try with inline frame,but then it shows like this:
^4(^3IHR^4)^4IRONHORSE RACING

and should be like this:
(IHR)IRONHORSE RACING

Ah yes, you will definitely need to process the string then, which means either JS or a completely different approach, which is to "assemble" your team mate gadget thingy entirely on a server (php, python, asp, ruby, ...).

Unfortunately it'll be quite difficult in JS, for startes it requires AJAX, which the Windows gadget thingy should support though. Converting hostnames using non-standard character sets is tough though, I'm not sure it can be done in a reasonably efficient and small fashion using JS.

Dygear
1st February 2010, 00:52
The function convert_lfs_text, from the LFSWorldSDK 1.9.5 Alpha (http://www.lfsforum.net/showthread.php?p=1340393#post1340393), can be used stand alone to parse this text into it's normally formatted html mark'ed up string.

<?php

reqiure_once('lfsworldsdk.php');

echo LFSWorldSDK::convert_lfs_text($str);

?>

NelsonGPV
4th February 2010, 23:59
I was wondering if it would be possible in the future, to add this suggestions in the LFS World pubstats.

Fisrt, I would like to be able to retrive the number of drivers from any country to have that number as statistic in a website.

Second, have the possibility of something like the world records but filtered just for my country or any specific country. This way we will be able to know who holds the best times on every track and car per country.

Hope you find the suggestions intresting
:)

Dygear
5th February 2010, 02:59
I was wondering if it would be possible in the future, to add this suggestions in the LFS World pubstats.

Fisrt, I would like to be able to retrive the number of drivers from any country to have that number as statistic in a website.

Second, have the possibility of something like the world records but filtered just for my country or any specific country. This way we will be able to know who holds the best times on every track and car per country.

Hope you find the suggestions intresting
:)

There is currently no way at all to get the country information so we can't even cross reference this information from multiple pubstats calls. I would at least like to be able to get the players country from their profile in the pubstats as this might greatly aide with localization.

So a huge Plus 1 for this idea.

avetere
5th February 2010, 09:56
There is currently no way at all to get the country information so we can't even cross reference this information from multiple pubstats calls.

This is one of the rare occasions (do you call it this way in english?! not sure ...), where you have to be corrected:
-----------
?action=pst
-----------
(online statistics of one racer)

requires: &racer=<racer>
optional: -
returns: distance in metres
fuel burnt in cl
laps
hosts joined
wins
second
third
finished
quals
pole
drags
drag wins
country
online status (0 = offline, 1 = spectating, 2 = pits, 3 = in-race)
current / last hostname (or blank line if not online or on hidden host)
last_activity_time(*) (Unix timestamp (UTC))
current / last known track(*)
current / last known car(*)

additionally, there is such thing as:
http://www.lfsworld.net/highlight_countries/highlights_<Country_Name>.txt
(not as useful though)
:nod:

Dygear
5th February 2010, 13:34
I stand corrected! (And believe me, this happens a lot more then I'd like to admit).

Thank you avetere!

Another example of me being wrong ... Damn it I'm starting to slip up on this stuff. I think I should study or something ... LOL (http://www.lfsforum.net/showthread.php?p=1365305#post1365305)

NelsonGPV
8th March 2010, 12:41
Yes i did try with inline frame,but then it shows like this:
^4(^3IHR^4)^4IRONHORSE RACING

and should be like this:
(IHR)IRONHORSE RACING

HI dmartin, did you solve this issue?

I found my self trying to do the same on my team website, and I would like to know if you manage to make it work?

Dygear
12th March 2010, 12:50
Vic, it's not showing my name in the Eagle Race Team (EAGLE) member list. I am a member, and the tag shows correctly in my profile page, but it's not registering that I'm a member of this team in the pubstats, or on the member list on the LFSWorld website GUI. Any idea what's up with that?

Dygear
30th March 2010, 00:44
As it turns out these two strings are not the same as far as get_stat2 is concerned.

http://lfsworld.net/pubstat/get_stat2.php?version=1.4&idk=35cP2S05Cvj3z7564aXKyw0Mqf1Hhx7P&ps=1

http://lfsworld.net/pubstat/get_stat2.php?version=1.4&ps=1&idk=35cP2S05Cvj3z7564aXKyw0Mqf1Hhx7P

As having the &ps defined before the &idk results in a Invalid IDKey error no matter what.

obmit
26th January 2011, 21:49
Hi all,
I am writing a little standalone (ie not a web page) app in Visual Basic (Ok who's that laughing? I can hear you) that allows a player to check almost all of their online LFS stats, well all the stats I can get anyway.

I'm using ?action=wr to get a list of all world records to allow a player to compare their online PB's against the WR's.
I know this isn't a very accurate guide to performance, race environment versus solo hotlapping, but hey, I was bored:shrug:
But also I would like to be able to show how old a WR is. But there is no time stamp available.

Can this info be gained another way ?

Or could this info be considered for some possible future update to the pubstats system?

P.s.
First post on here, so, Hi to everyone who comes to this part of LFS land
:wave2:

Dygear
26th January 2011, 23:23
(Ok who's that laughing? I can hear you)

Sorry, that was me.

Can this info be gained another way?

Not right now, no, Victor will have to add it.

obmit
27th January 2011, 08:02
Aaah ok, thanks for the response Dygear, guess I shall just have to wait and keep my fingers crossed.

avetere
28th January 2011, 11:50
Well, you could retrieve the wr alongside with the racername (which is provided) and afterwards do a seperate query on all that racer's hotlaps (?action=hl), where you pick out the one for your desired track/car, as there is a timestamp there.
Of course his produces an additional query for each wr (or at least each wr that is done by one, who didn't do another one), so it would be considerable keeping track of wrs and only fetching the timestamp, when one is changed ...

obmit
28th January 2011, 20:22
I had looked into doing it that way avetere.
The way I'm implementing the comparison between PB and WR is by downloading the relevant data, processing it into a text file (one for the players PB and another for the WR list and saving them for future use, with options to update the data) extracting the relevant information from the pre-processed data, calculate the time difference and displaying. Doing it this way means I can show the info instantly(more or less), without imposing any delay for the user by retrieving data "live". It also means the app can be used "offline".
Thankyou avetere for "reminding" me of that method.
I shall have a little play around and see what I can conjure up.

P.s. I'm doing this as a learning project, trying to keep the old brain firing on all cylinders.

Victor
18th February 2011, 15:44
I'm doing some pubstat updates and will soon update to version 1.5

The current changes are :
v1.4 => v1.5
------------
NEW ?action=counters - get global car/track lapcount
?action=wr - added timestamp
?action=ch - added optional country filter

These already work, but only if you indicate with &version=1.5

If you have any feature requests, then please ask for them now. Otherwise I'll update to v1.5 tomorrow.

avetere
18th February 2011, 16:40
Well, what I would really like is:
- have action=fuel combined with action=pb, thus having both datasets with a single query
- have action=pb altered in a way, that outdated PBs are returned with their actual times instead of giving all zeros (perhaps have an "outdated flag" somewhere) as it can be seen on lfsworld


A real kickass-feature (though I doubt it would be implemented, but one should be allowed to dream) would be:
give pubstat an array of racers and fetch, whether they have done any laps (maybe even on a particular set of car/track combos) within a set threshold,
thus enabling one to update his/her database only, when it is neccessary.
(This would for example avoid me to fetch the hostlist every 2 minutes just to see, if any of the racers might need an update.)

Or (even more dreaming): Have only PB-data (PB and laps) of a racer gained up to a specific date (Though I'm quite sure, this won't be possible as it requires to store a racers pb-history (which would actually be veeeeeeeery cool))

... well ideally I'd take a combination of all of that ... as to be realistic, I think the first two could be worth a try anyway ;)

thanks in advance ... :nod:

obmit
18th February 2011, 18:12
Thankyou Victor, the new ?actions work nicely :thumb:
I would also like to second avetere's idea of combining PB and FUEL usage requests into one call (if possible).

avetere
18th February 2011, 20:28
Just got another idea:
How about a history of laps driven by a racer (giving a list containing server, track, car, laptime and timestamp for within some time from the query - say a day or 12 hours or so)
Just if it is possible that is ...


Oh, btw:
For some days each morning around 6am (CET) I'll get this from pubstat:
<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>Can't tell, if it's a bug or a feature ... so I'd appreciate a comment :D

Victor
18th February 2011, 20:39
At 6am CET a database backup is done. But this takes a few minutes and (unfortunately) systems stall a bit then.
So it's normal in the sense that it's known. Can't really do anything about it though afaik. Not easily anyway.

avetere
18th February 2011, 21:03
OK fine! I imagined something of the kind ... just wanted to ensure though, thanks! ;)

Dygear
19th February 2011, 06:08
Have action=fuel combined with action=pb, thus having both datasets with a single query

Agreed.

have action=pb altered in a way, that outdated PBs are returned with their actual times instead of giving all zeros (perhaps have an "outdated flag" somewhere) as it can be seen on lfsworld

No opinion right now really, but it can't hurt.

give pubstat an array of racers and fetch, whether they have done any laps (maybe even on a particular set of car/track combos) within a set threshold.

Yes, yes, yes! Although, this might get ugly to parse in anything other then a XML / sterilized format, it's a pretty awesome idea. The URL does allow you to send arrays to it via the &var[]= method, and you can even lable what you want to go where. So for example, &racer[1]=Dygear&racer[2]=avetere&cars[1][]=FXO&cars[1][]=FOX&cars[2][]=MRT&cars[2][]=BF1 making it really easy for Victor to parse. Although I'm pretty sure that the URL limit is like 355 charters, so you might hit that on a larger query.

Or (even more dreaming): Have only PB-data (PB and laps) of a racer gained up to a specific date (Though I'm quite sure, this won't be possible as it requires to store a racers pb-history (which would actually be veeeeeeeery cool))

Can't hurt, although I would prefer that this option would be standard across the board.

avetere
19th February 2011, 06:49
Although I'm pretty sure that the URL limit is like 355 charters, so you might hit that on a larger query.

Seems to me, IE with just above 2000 characters is the limiting factor (or was, not sure, how it is now with the new versions) as servers seem to be able to cope with those lengths:
http://www.boutell.com/newfaq/misc/urllength.html

avetere
19th February 2011, 09:49
Oh, just one more thing:
How about giving the textfile with all those options (basically those on post 1), if no or maybe "help" action is requested? that one maybe even without pubstat-key?

And I'd appreciate a list of all the error-messages (maybe as action=errorcodes ?) ;)

Dygear
19th February 2011, 12:53
Oh, just one more thing:
How about giving the textfile with all those options (basically those on post 1), if no or maybe "help" action is requested? that one maybe even without pubstat-key?

And I'd appreciate a list of all the error-messages (maybe as action=errorcodes ?) ;)

I have a list of error messages within the LFSWorldSDK, your more then welcome to use the code from there in part or in whole as it's released under the MIT license.

avetere
19th February 2011, 14:02
Will have a look at it (had downloaded it even earlier but forgotten about it somehow :shrug:).
Nevertheless, I'd appreciate an official list, as you are missing at least one of those in your file (see your thread) and god knows how many we haven't sumbled upon ... :nod:

Victor
19th February 2011, 15:03
Although, this might get ugly to parse in anything other then a XML / sterilized format

Sat in the ambo a bit long again have we? :P

Although I'm pretty sure that the URL limit is like 355 charters, so you might hit that on a larger query.

for what it's worth, the maximum length the web server will allow is around 4000 bytes.

But I don't think i'm going to implement this (now) tbh.

I've done the pb+fuel now though. Looking at the other requests now.

I've no pb history data btw, so i can't display that.

Dygear
19th February 2011, 16:55
Sat in the ambo a bit long again have we? :P

Yeah, the diesel fumes are starting to go to my head.

for what it's worth, the maximum length the web server will allow is around 4000 bytes.P

But I don't think i'm going to implement this (now) tbh.P

I understand, that would be quite a bitch to implement.

I've done the pb+fuel now though. Looking at the other requests now.P

Thank you.

I've no pb history data btw, so i can't display that.

No problem, thank you.

joshdifabio
19th February 2011, 19:05
Victor, out of interest, do you happen to have a record of all of the hotlaps ever uploaded to LFS World?

Victor
19th February 2011, 19:35
well, there's the hl_log data. I started recording that on 21 Dec 2007. So it's not _all time_, but quite some time. 135000 entries.

joshdifabio
19th February 2011, 20:00
Ah sweet. I might like to get that from you some time in the future if possible.

Dygear
19th February 2011, 20:19
There is on more thing that has nothing to do with LFS World stats. Make LFSWorld / LFS an OpenID provider. It would greatly help the next community vote, it would also help 3rd party websites authenticate that clients are who they say they are.

Victor
22nd February 2011, 11:17
pubstat has been updated to v1.5 now.

v1.4 => v1.5
------------
NEW ?action=counters - get global car/track lapcount
NEW ?action=help - displays the full pubstat help text (omitting ?action will do the same)
?action=wr - added timestamp
?action=ch - added optional country filter
?action=teams - added optional team filter to search for only one team instead of downloading the whole list
?action=pb - added fuel data (Given in % of tank capacity)

Complete info can be found in the first post of this thread.

obmit
22nd February 2011, 12:14
Thanks again Victor :thumb:

cargame.nl
22nd February 2011, 13:14
?action=ch - added optional country filter
?action=teams - added optional team filter to search for only one team instead of downloading the whole list
very nice!

avetere
22nd February 2011, 13:46
Would have liked to see those outdated times on pb, but nevertheless:
Nice one, thank you!


A few notes though:
NEW ?action=help - displays the full pubstat help text (omitting ?action will do the same)This will now happen any time, an idk is omitted or false instead of giving the appropriate error-message (which I believe is a bug)

Version numbers
---------------------
Since v1.1, Version numbers have been introduced, to make future updates easier while not having to disrupt your existing scripts. If you were already running a script, you don't have to change anything, unless you want to make use of the new features that come with the latest versions.
The current version is v1.4Well ... this should be 1.5 by now ;)

Victor
22nd February 2011, 14:05
A few notes though:
This will now happen any time, an idk is omitted or false instead of giving the appropriate error-message (which I believe is a bug)

I cannot reproduce this. Are you sure you didn't just omit the &action variable?

In my code I do this check (for action=help or action omitted) before I do anything else, so it can't really be that a wrong idk shows the help. It's unrelated.

avetere
22nd February 2011, 14:17
Oh yeah ... just checked my browser's history and i mistyped it ...
I did:
?version=1.5?action
instead of:
?version=1.5&action

So, the error was entirely on my side :schwitz:

Flame CZE
23rd February 2011, 13:55
Thanks Victor for the updates. But I see that the track stats show laps only. Would it be possible to add another parameter to be able to choose between laps, kilometres and miles?

Victor
23rd February 2011, 16:11
i thought about that, but you can easily calculate km/miles yourself. Just make a list with the lengths of the tracks and multiply.

Flame CZE
23rd February 2011, 16:47
Hmm, good point actually :)

Dygear
24th February 2011, 00:21
I'll consider it for the next version of the SDK.

avetere
24th February 2011, 08:07
i thought about that, but you can easily calculate km/miles yourself. Just make a list with the lengths of the tracks and multiply.


That's the way, I do it now ... but actually this will produce an error, whenever a track (and thus it's length) is changed, as happened to BL1 not too long ago ;)

avetere
1st March 2011, 08:56
Hm ... there's one more thing, I didn't come across earlier:

If a racer chooses to hide his online stats, a get_stat-query will return the error-message:
"no valid username"

As that actually IS a valid username (the license exits) I'd rather have a message like "stats hidden" to be able to separate those two values.

CrazyICE
21st April 2011, 20:38
Hi Victor,
what about Open Track Configuration...

Will PubStats give you the correct track config like AS2X and so on...

Will this be considered in a new PubStats version?

Victor
21st April 2011, 20:52
No stats will be recorded for open configs because I don't know anything about the custom layout. So I cannot store pb's or anything like that. They would have to be stored by layout.
Hotlapping will also not be possible with open configs.

troy
21st April 2011, 21:04
How hard/much work would it be to include the (semi) official community pack people intend to create there (http://www.lfsforum.net/showthread.php?t=73903). I think that would be a nice way trying to make people use a standard set of layouts in different league and events, offline hotlapping isn't too important in my view but saving pb's for those tracks would certainly be a nice feature.

Victor
21st April 2011, 23:11
The only way I can see that reliably happen is if we include these layouts in LFS as new configs and fully support them, like any other config.
If we'd make a mechanism for stats recording for layouts instead, without including them in LFS, there'd be a zillion different layouts to record stats for (including different versions of the same layout), so that'd become a mess and I wouldn't even want to record stats for such a system I think. There need to be some rules, and hence the layouts should be included in LFS itself as configs. Perhaps then there could be even be path files for them, making everything nicer.

I'm pretty sure there's no time for that now, but perhaps in the future after the next patch and when these configs have been tested, Scawen can be pursuaded to include them, if that's possible.

Bmxtwins
21st April 2011, 23:41
I think after this test patch, then you guys should look into it. Maybe then only add a select "favorite" 4 or 5 layouts. Seeing as this is actually a TEST patch.

Dygear
22nd April 2011, 01:40
The insim should be used to record, as it works fine with AutoX, the open config would just work as a large AutoX layout and you should be able to score hotlap data from there. It would be nice if there was an option for the hot lap checker to be enabled and reported to the InSim app if someone hits an object, or goes on the grass or something.

CrazyICE
22nd April 2011, 07:27
No stats will be recorded for open configs because I don't know anything about the custom layout. So I cannot store pb's or anything like that. They would have to be stored by layout.
Hotlapping will also not be possible with open configs.

Hi Victor, thanks for your answer.

But what I mean is the host list, not the stats themself.
So if you retreive the host list with all the infos like Name, Cars, Track, Version and so on!

Victor
22nd April 2011, 11:05
ah right, yeah the host list will show the open configs.

CrazyICE
22nd April 2011, 12:03
ah right, yeah the host list will show the open configs.
automaticially, so no PubStats version change or do you introduce a new PubStats version (v 1.6)?

Victor
22nd April 2011, 12:09
automatically.

Currently the track is indicated by TCR (track config reverse). The reverse byte so far has been 0 or 1. After the patch open configs are indicated by either 2 or 3 (X or Y).
So the reverse byte's range will be from 0-3. (forward, reverse, forward open, reverse open)

CrazyICE
22nd April 2011, 12:32
ok, thank's for that info...
so I can consider this in the next mates@track NG (http://www.hpr-network.com/index.php?page=software&prod=ovmt&lang=enu) version.

CrazyICE
23rd April 2011, 19:32
I don't know if I understand the COUNTERS command right.
I expect getting a list of lap counts by either all trakcs or all cars.

By tracks:
http://www.lfsworld.net/pubstat/get_stat2.php?action=counters&type=track&version=1.4

By cars:
http://www.lfsworld.net/pubstat/get_stat2.php?action=counters&type=car&version=1.4

But I always get a list by tracks. Where is my mistake?

avetere
24th April 2011, 07:06
type=cars ;)

CrazyICE
24th April 2011, 20:10
type=cars ;)
loooooooool...thank's :thumb:

Dygear
8th May 2011, 09:05
An additional funny is the online-highlights-log-per-country that you can get in .txt format (linux, so with \n line breaks, as is always the case on our sites really) :

http://www.lfsworld.net/highlight_countries/highlights_<Country_Name>.txt
***<Country_Name> Mind the capitals and underscore for spaces.***
Example: http://www.lfsworld.net/highlight_countries/highlights_United_Kingdom.txt

For use on your own site :)

First could you provide a list of current countries that you support, that would be great!
Second, the version 1.5 text file on here is only 162 bytes, and that's because it's text is an HTML error page in a txt file. Something went wrong with that upload.

Victor
8th May 2011, 17:36
First could you provide a list of current countries that you support, that would be great!
http://www.lfsforum.net/showthread.php?p=1268645#post1268645

Second, the version 1.5 text file on here is only 162 bytes, and that's because it's text is an HTML error page in a txt file. Something went wrong with that upload.

fixed

Dygear
8th May 2011, 19:41
http://www.lfsforum.net/showthread.php?p=1268645#post1268645

Thank you sir! (I will use the search function next time, sorry, I was being lazy.)

-- Edit --

Is there anything YOU want to see in the next version of the LFSWorldSDK Victor? I'll of course keep the compression support, but I think I'm going to go back to the old style of reading the binary data, but keeping it's key value as that of the serilzed format, to reduce the cost on servers running the LFSWorldSDK.

LFSWorldSDK 2.0.0 aims to be highly polymorphic in nature, if I like the feel I'm going to write it into PRISM as well. I'm also thinking about chaging the baseline required php version for the LFSWorldSDK to 5.3.0 for the 2.x branch, older versions of php will be supported in the 1.x branch.

Dygear
1st June 2011, 08:58
How many queries does LFS World pubstats do a month? I'm just wondering as looking over my at the pubstats details apparently people are leaving the LFSWorldSDK in it's default configuration because my key that is getting shipped with it is still being used.

May 2010 48051 1272.32Mb Free £ 0
June 2010 58456 1489.08Mb Free £ 0
July 2010 82217 2033.42Mb Free £ 0
August 2010 62572 1519.36Mb Free £ 0
September 2010 52238 1292.31Mb Free £ 0
October 2010 46647 1136.63Mb Free £ 0
November 2010 33928 771.86Mb Free £ 0
December 2010 47180 1051.45Mb Free £ 0
January 2011 46076 1071.68Mb Free £ 0
February 2011 42978 976.31Mb Free £ 0
March 2011 34587 767.93Mb Free £ 0
April 2011 46933 1020.4Mb Free £ 0
May 2011 47844 1077.01Mb Free £ 0

I've not used the LFSWorldSDK in about a year, and I was wondering if we could find out both how much the pub stats is using each month, and how many people are using the LFSWorldSDK. Also, is there anything I can do in the next version of LFSWorldSDK to make it more obvious to you that they are using the LFSWorldSDK? Setting a user-agent string perhaps?

Victor
1st June 2011, 18:41
In may there were 5,575,098 requests and 60,746MB of data was transmitted (that's 2 requests and 22.5KB a second). So your default key is used in less than 1% of requests. Most ppl will have entered their own key, which is good!

As for setting a user-agent, you could do that. Though atm i don't really look at that info for stats or so. But i guess it would show up in webalizer website stats automatically then, in the browsers list.

misiek08
1st June 2011, 20:04
1 req / 5s is not enough. I was working on a project which will need 2 req/s (with buffer system and cache system) but I don't wonna pay anything for that, because the project is free too.
@Victor - maybe you will allow me and Dygear to make an LFSW relay. It will work this way: Someone is not using ident key. He enter his ident-key to our system. Other services ask our system for stats and here is the magic: we have databse with keys and we can provide unlimited access for free on multi ident-keys. We can do it without publishing but if you will allow it, it will be legal and helpful for some ppl that don't have money to pay for LFSW API.

Dygear
1st June 2011, 20:21
Well, we don't have to even go that far, nor do I have the money to run a server on the scale that is LFSWorld. I could how ever add an option to cache results for a period of time within the LFSWorldSDK, but as the options change from server to server on what's available it might be an issue finding a common ground. It's like who has access to a database, what is the database type, sqlite, mysql, mssql, something else? Do they have PDO installed? Should it use a flat file system? Can this run in safe mode without giving the consumer many headaches.

LARK2355
20th June 2011, 16:14
i dont know if this is useful to anyone but i got fed up programming an array for track names etc so i have created an xml file for it

DarkKostas
13th July 2011, 16:12
I would like to ask 2 questions.

1) When you use premium, does only the Ident-Key gets premium or even using Username/Password is the same

2)Is it possible to use "&action=pst" for more than one racers to see their online status or am I forced to check them 1 by 1 each 5 seconds(if not premium)?

Victor
13th July 2011, 16:46
1) you can use either, but recommended is to use the IdentKey,
2) you'll have to do it one by one.

pezia
22nd November 2011, 16:53
Will it be a method to validate a username through pubstat? I would like to disable users on our site with non-lfsworld usernames, but couldn't find a method for that yet.

Victor
23rd November 2011, 16:54
There is currently no waterproof way to determine wether a username exists or not. You could see if a username returns stats via pubstat (the 'pst' request type), but if a user has decided to hide his or her stats, you'll get no stats for that user. Hence there is no waterproof method I'm afraid.

pezia
24th November 2011, 06:05
Yes, "pst: no valid username" is given for hidden stats.
Could you maybe give sg. other than that back when someone has hidden stats? Eg. pst: stats hidden

A version bump would be nice anyway;)

Victor
24th November 2011, 19:39
I'll make a note and then I'll have a look soon.
If anyone else has any other features, now's the time :)

[Audi TT]
25th November 2011, 06:12
The numbering of the hotlaps, is not enough. If you open any of the rank-and-click on any account, it opens with filter "- By car:". In my opinion, should come off with a filter "- By Rank:" Correct name in the "By Car"

p.s. At your discretion

translate the google((

DANIEL-CRO
25th November 2011, 12:15
Victor, in hotlap analyser there are many hotlaps that can't be loaded
e.g. Unable to load RAF file {SR}_Negão_BL1_XFG_132940.raf :
pls fix

[Audi TT]
25th November 2011, 13:21
This is probably because of the Portuguese symbols (letters). As well as Spanish symbols.

Victor
27th November 2011, 21:18
Please keep this thread on topic and post problems with websites in the website bugs section. I receive emails for all new threads there, so I never miss one.

This thread is about the pubstat system.

Okram
29th November 2011, 14:41
Nice if i see driver license. Right now must calclulate my self, what license driver have. Sometime this fails and i must do more work (if have free time).

EDIT:
If LFS Desktop (http://www.lfsworld.net/?win=stats&racer=Okram) show user birthday, then pubstat show this. This is nice too ;)

Sil3ntSkull
28th April 2012, 09:27
Hi Victor, it's from about two weeks that my tracker (based on Hottraker 2.0) every update can't get all data (it's for my team of 5 racers) but it retrieve only partial data. I use a premium key and my balance is debited every request though data are incomplete. Can you help me?

Victor
28th April 2012, 11:33
Which stat request type are you referring to? Or maybe you could even mail me the whole url that you use for the stats you're having problems with. Then I can quickly see for myself.
If you don't know my email address, just use https://www.lfs.net/?page=mailus