1

Topic: [TOOL] TwRequest.php - a server status script

This PHP script can

  • load the server list from the master servers,

  • request the status of 0.5 and 0.6 servers and

  • even more.

But the best is that it works fast. Requesting the server list and the status of every server in this list takes around 5 seconds. (It can vary. With some fine tuning it is finish within 2 seconds on my virtual server.)

I've seen a some other PHP scripts doing the same, but usually the scripts take a minute or more to fetch the whole list, because they wait for a server's response before requesting the next. With 1000 servers where 60 of them time out in one second, such a script of course takes more than a minute. So I've taken a different approach and did it like the Teeworlds client: parallel requests.

My script also provides methods to request just the count of servers on a master server and the last version and list of default maps from the version server. Unfortunately the version server is offline, so i couldn't test the last two methods. Additionally my script contains a list of all countries that Teeworlds 0.6 supports (maybe even more, because I took the whole ISO 3166-1 list), with the short token and the full name.

For documentation and download, see this site: http://code.teele.eu/twrequest.

2 (edited by TeePhoenix 2012-06-10 16:14:04)

Re: [TOOL] TwRequest.php - a server status script

Deleted.

The face of terrorism is called United States of America!

3

Re: [TOOL] TwRequest.php - a server status script

If you're working on such a php script, I would really love to see you using this library for localizing the servers. Would be awesome to see which server is hosted where :>

Not Luck, Just Magic.

4

Re: [TOOL] TwRequest.php - a server status script

@TeePhoenix: http://test.teevision.eu/test/index.php

@Dune: As this library isn't installed per default it doesn't make that much sense to require it.

5

Re: [TOOL] TwRequest.php - a server status script

Great work dude!

6

Re: [TOOL] TwRequest.php - a server status script

You don't see quality code like this often around here, +1

Kinda reminds me, I should work on my serverlist lib (Python).
IIRC I was working on IPv6 support.

P.S. It's asynchronous as well.

7 (edited by traitor 2013-08-09 01:47:09)

Re: [TOOL] TwRequest.php - a server status script

I love your approach and after some reasearch I have found someone using it
they seem to keep it up and collect more data over time. Let us see.