The online racing simulator
Problem with pubstat
Hello,
we have a script on our forum, which checks on LFSW if any of the team members are racing online. For like a year now, it was working perfectly.
Lately, however (iirc since the Y30 was released), the data that the script prints out after analyzing lfsw's response to the pubstat call are extremely wrong.

Were there any changes made to the response data layout?

Thanks
no, nothing has changed lately.
which pubstat data are you requesting?
Get Who's Online Based on Team Members.

<?php 
php

    $teamName 
'Euro Racing Group';

    require_once(
'lfsworldsdk.php');

    foreach (
$SDK->get_teams() as $Team) {
        if (
$Team['team'] == $teamName) {
            
$teamMembers $Team['members'];
        }
    }

    foreach (
$SDK->get_hosts() as $Host) {
        if (
$Host['nrracers'] != 0) {
            foreach (
$Host['racers'] as $Racer) {
                foreach (
$teamMembers as $Member) {
                    if (
$Racer == $Member) {
                        echo 
$Return[$Racer] = $Host['hostname'];
                    }
                }
            }
        }
    }

    
print_r($Return);

?>

I am requesting the http://lfsworld.net/pubstat/ge ... .php?action=hosts&idk=...

Could there be any problems with my ident key? ( i am using it since the beginning and it usually tranferres hundreds of MBytes per month).

Dygear's script doesn't work either.
Apparently, the number of returned hosts is zero.
I don't know really. You'll have to debug your script and see what it is that you are receiving.
When I run that url manually, i get all hosts info, so your "number of returned hosts is zero" is not correct.
hmm, then maybe there is an issue with my host's php, as the "number of returned hosts is zero" also applies to Dygear's LFSWorldSDK..
I'm gonna research it a bit and then I'll come back
Thanks
Hello,
maybe this also falls under the same category:
Since a while Starblue's Event Tracker can't fetch people's PBs via pubstat anymore, it always worked perfectly and we haven't changed anything...
The log only outputs "ERROR - Something failed while retrieving PB!
java.lang.NumberFormatException: For input string: "this" "
a while ago i added a flooding check - there were/are several people who, when tarpitted, were just doing repeating requests (like 10 per second) until tarpit-time has passed. I block those now (for half an hour or so), because it's bad practise do flood someone until you get an answer.

maybe that's what's causing that script to fail, I don't know.
Indeed, I tested with my IDKey and PS set to true.

FGED GREDG RDFGDR GSFDG