Page 1 of 1

Serverlist script

Posted: Mon Sep 06, 2004 11:27 am
by Capm
I need a specific serverlist script in php.

I need it to update a list of live D3 servers, and send that information into a text file in this format:

servername,ip,port,mode,#ofplayersingame,max#ofplayersingame,mapname

servername,ip,port,mode,#ofplayersingame,max#ofplayersingame,mapname

servername,ip,port,mode,#ofplayersingame,max#ofplayersingame,mapname

servername,ip,port,mode,#ofplayersingame,max#ofplayersingame,mapname

(each line should appear something like this:
2v2 Descent.cx,64.238.111.11,2100,Team Anarchy,0,4,indika.mn3
...)

The path for the output file would be
/files/webtext/serverlist.inc.txt

Its for use in our new website, which is nearing completion. Can anyone help with that?

Posted: Fri Sep 10, 2004 11:45 am
by Capm
Anyone?

Posted: Fri Sep 10, 2004 1:48 pm
by fliptw
I did something similar a while ago, but im not sure if I have the code still.

in short, you need to understand the query protocol for D3(should be well documented, so you don't have to sit with a packet sniffer), and have it update a DB/text file every 90 seconds or so.

Posted: Fri Sep 10, 2004 3:39 pm
by Capm
If it updated whenever the page was loaded, that would work good too.

Posted: Sat Sep 11, 2004 10:25 pm
by fliptw
Capm wrote:If it updated whenever the page was loaded, that would work good too.
you run the risk of flooding the servers with query requests. updating at a given interval makes more sense, than updating whenever someone requests a page, especially if more than one person requests a page at the same time.

Posted: Sat Sep 11, 2004 10:39 pm
by DCrazy
Yeah the only real way to do it would be to have a query script run as a cron job and update a file that the webserver could serve.

Posted: Sun Sep 12, 2004 12:03 am
by Capm
Well, the file is in the members section of the site, I don't forsee it being used too awful much.
Certainly not enough to cause problems.

Posted: Sun Sep 12, 2004 10:46 am
by Capm
Actually, an "update list" button would work, with a timestamp that could be pulled by the page and displayed. That way if the list is fresh, it wouldn't need to be updated again.

Posted: Sun Oct 03, 2004 11:13 pm
by Capm
And I could put that where only certain people could access it, so there wouldn't be any flooding of servers, only time the list is used is for updating match server information when inputing a match into the database.