A class for Teeworlds server and master server requests
TwRequest.php is a extensive PHP class that provides parallel requests for Teeworlds 0.5 and 0.6. It can request
- the status of servers (0.5 and 0.6),
- the number of running servers on master servers (not distinguished between 0.5 and 0.6),
- the list of running servers on master servers (0.5 and 0.6) and
- the latest version number and the list of the default maps from the version server (experimental).
The big thing is that it can do similar requests parallel which is faster than waiting for every response.
- If a master server returns a server list which count of servers can be divided by 75, it can happen that the connection times out. Due to the circumstances that there is no server count that distinguish between 0.5 and 0.6 servers, that the number of servers could change just in the moment and that there is no "end of list"-pattern, it is not always possible to say whether the end of the list is reached or the script has to wait for more packets from the master server. So the script waits until the timeout is reached. By default the script will wait one second for the server list.
Visit Teele’s personal page for more projects and information on Teele.