I am writing the code to get a list of Internet servers.
Currently it's based on an HTTP request to a server. I've written 2 PHP scripts, one to get the server list and and one to advertise a server. Each a time one of these scripts is ran, it cleans its database, so we don't get outdated games in the list.
requirements:
a web server with PHP
Internet server discovery
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
Internet server discovery
=>;-D Penguin Powered
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
I've already put the 2 scripts on ta3d.darkstars.co.uk, but currently it's for testing purposes only. I've sent a mail to AF to ask him if it can stay like this, just wait and see
So currently it works using default configuration (server load isn't high at all, it only updates the list every time a client refresh the list or a server updates its status, clients and servers refresh their list/status every 150 sec.)
So currently it works using default configuration (server load isn't high at all, it only updates the list every time a client refresh the list or a server updates its status, clients and servers refresh their list/status every 150 sec.)
=>;-D Penguin Powered
What you have at the moment uses mysql, and I would have thought it would be more logical to use a flat file based storage considering the cost of sql queries.
Also that way you could remove getserverlist.php completely. Also it would reduce the load on the server greatly, as you could return all the entries and do the filtering client side, which would be far more efficient than passing a part of the sql query to the server (and would be far safer than allowing malicious sql queries to be inserted)
Also wouldn't there be a need for unregister.php ? To help reduce the 'timeout' factor?
I'd like to see the load generated by these scripts numerically evaluated so I know exactly what sort of load they would generate when used normally.
Also that way you could remove getserverlist.php completely. Also it would reduce the load on the server greatly, as you could return all the entries and do the filtering client side, which would be far more efficient than passing a part of the sql query to the server (and would be far safer than allowing malicious sql queries to be inserted)
Also wouldn't there be a need for unregister.php ? To help reduce the 'timeout' factor?
I'd like to see the load generated by these scripts numerically evaluated so I know exactly what sort of load they would generate when used normally.
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
I used mysql queries only because it was easy and quick to write . I just wanted to have something to experiment on.
There is no need for a unregister.php file since register.php called with stupid parameters will remove the server from the list (currently TA3D sends a request telling there is 0 player slots available, which is enough to remove it from the list).
I'll rewrite those scripts and add some statistics code
There is no need for a unregister.php file since register.php called with stupid parameters will remove the server from the list (currently TA3D sends a request telling there is 0 player slots available, which is enough to remove it from the list).
I'll rewrite those scripts and add some statistics code
=>;-D Penguin Powered
Who is online
Users browsing this forum: No registered users and 25 guests