You are not logged in.

#1 20 Apr 2007 3:30 pm

freak
Senior Member
Registered: Mar 2007
Posts: 32

lookup list

Hello,

i made an look up list with all rewuests, but i had not all codes, is it possible to request all battlefield 2142 Players also how much it gives?
which code? and what url?
greetz

Last edited by freak (20 Apr 2007 4:43 pm)

Offline

 

#2 21 Apr 2007 7:45 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: lookup list

getleaderboard will get a list of all players (is that what you're asking?).  but you may have to request them in parts (like 1-200, then 201-400, then 401-600...).  the query takes 2 parameters: pos (the starting point), and after (a count of how many players to return).

Offline

 

#3 21 Apr 2007 9:56 am

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

hello,

no i mean how many bf2142 players it gives over the world .

Offline

 

#4 22 Apr 2007 5:15 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: lookup list

I don't understand what you mean by that.

Offline

 

#5 23 Apr 2007 3:26 am

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

ok, ea hat on there site thats it give 358000 player , this number can i request it ?

Offline

 

#6 23 Apr 2007 10:41 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: lookup list

well, they have direct access to player accounts, so thats a pretty easy thing for them to report.

in order for you to get that info, you'll have to get it from getleaderboard and compute that yourself.

Offline

 

#7 25 Apr 2007 8:11 am

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

hello,

ok, i found this site ;

http://battlemaster.tk-software.de/Online/

there you can see if the masterserver is on or offline. do you know how to query the masterserver?

i want to make an litte script thats shows "ONLINE" or "OFFLine" there can tzhe users see if the server is off again

Last edited by freak (25 Apr 2007 8:13 am)

Offline

 

#8 25 Apr 2007 8:41 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: lookup list

the master server is at master.gamespy.com:28900.  it should be pretty easy to try to open a socket to that server (if you can connect, its online, if you cant, then its offline)

the master server and game servers use the gamespy version 4 server protocol (I think its version 4) and there are a few places out there that document how to query that.  there are a few apps and scripts out there that you could look at (downloads here(in PHP), here (in C) and lsgl (in PHP)

Offline

 

#9 25 Apr 2007 10:26 am

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

ok,

i wrote here something but why says he thsi error ?

Code:

Warning: fsockopen(): unable to connect to master.gamespy.com:28900 in /home/p3271/html/bf2142/server.php on line 2

Code:

 <?php
$fp = fsockopen("tcp://master.gamespy.com", 28900, $errno, $errstr, 15);
if (!$fp) {
    echo "<br><br><b><u>MasterServer ist Offline</b></u>";
} else {
    echo "<br><b><u>MasterServer ist Online</b></u>";

    fclose($fp);
}
?>

it must go or what make i wrong?

Offline

 

#10 25 Apr 2007 11:22 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: lookup list

I don't know.  I tried that code and it prints: MasterServer ist Online


maybe a problem with your server's ability to open sockets?  try increasing your timeout.

Offline

 

#11 25 Apr 2007 11:23 am

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

i had php4 , gives another code as fsockopen ?

Offline

 

#12 25 Apr 2007 11:34 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: lookup list

fsockopen is the same in 4 and 5, and I was using 4 too. 

try:

fsockopen("tcp://master.gamespy.com", 28900, $errno, $errstr, 30);


maybe you are far away from the server, and the connection was timing out before it could connect?

Offline

 

#13 25 Apr 2007 11:43 am

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

MadHatter :

fsockopen is the same in 4 and 5, and I was using 4 too. 

try:

fsockopen("tcp://master.gamespy.com", 28900, $errno, $errstr, 30);


maybe you are far away from the server, and the connection was timing out before it could connect?

i test it with 50 but i dont think thats is the timeout, its the code, gives another code then a socketopen?
sockeropen is aktivated on my space  i dont check it ?

Offline

 

#14 26 Apr 2007 4:59 am

winsr
Extreme Member
Registered: Mar 2007
Posts: 90

Re: lookup list

Hi guys, well the getleaderboard, doesnt permits you from getting that much info, like 1-200, actually is has a limit, and its preatty low, its 1-18, or you'll put start at 1 and bring 17, and it will give you 18 players, since it take 0 base on the bring part. Summing things out, you can only retrive 18 player at a given query to the leaderboard

Offline

 

#15 28 Apr 2007 12:32 pm

freak
Senior Member
Registered: Mar 2007
Posts: 32

Re: lookup list

winsr :

Hi guys, well the getleaderboard, doesnt permits you from getting that much info, like 1-200, actually is has a limit, and its preatty low, its 1-18, or you'll put start at 1 and bring 17, and it will give you 18 players, since it take 0 base on the bring part. Summing things out, you can only retrive 18 player at a given query to the leaderboard

hi, thats not allright.
you request the first 17 and save then in an new array,then you order this you can request more then 17.

Last edited by freak (28 Apr 2007 12:34 pm)

Offline

 

#16 01 May 2007 5:55 pm

winsr
Extreme Member
Registered: Mar 2007
Posts: 90

Re: lookup list

Yeah thats what i meant when i put at a given query, you take 17 at a time, and you use the hit list value on the first query to know how many guys are. Since im from a small country, it only takes 3 calls to get the hole leaderboard for my country, so i retrive them all at once, but it is smart to group the call if you plan to do it for a bigger country.

Offline

 



© 2003 - 2018 NullFX
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License