[Crossfire-wiki] [Crossfire DokuWiki] page added: dev_todo:metaserver_improvements

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Apr 20 01:19:29 CDT 2007


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2007/04/20 01:19
User        : 
Edit Summary: created

==== Metaserver Redo ====

The current metaserver has room for some improvements.  The biggest right now is that there is a single metaserver (thus single point of failure).  It also doesn't record all the information that would be useful.

Currently, the metaserver records this informatin:
  * IP address
  * Hostname (provided by server - not resolved by metaserver!)
  * number of current players
  * version of the server
  * free form comment set by the server admin
  * number of bytes server has received
  * number of bytes server has sent
  * how long server has been up.

Proposal for improvements:
  * All the fields currently present above
  * Codebase for server, maps, & archetypes.  In this way, more readily apparantly what a server is running.  This would be text provided by the server.
  * metaserver should confirm hostname matches IP address from request.  This currently isn't feasible because doing nameservice lookups could time out, causing server to hang up
  * SC_VERSION and CS_VERSION of the server - in this way, client could filter out servers it know it couldn't support.
  * A text flags section - different flags have different, but standardized, meaning.  $ could be pay to play, P means player killing, etc
  * Multiple metaservers, so there is not a single point of failure.

=== Thoughts on Implementation ===

Making it a web based service (cgi-bin script or php script) is a good way to go.  The web server deals with running multiple copies at the same time - just, we don't care as much about timeouts in resolving the host name.  Web based script access is also quite common, which means that it would be much easier to get multiple instances up compared to requiring a custom program to be run.

While overkill, tieing it into a mysql database on the back end takes care of file locking/contention issues.  A secondary table could be used to blacklist certain servers, typically those that are misconfigured.

There would be 3 scripts to handle this:
  - Script that the server uses to update information
  - Script that the client uses to get server information.
  - Script that generates HTML table that people could point their web browser at.

Script 1 could be done relatively simply by passing values in the URL - http://metaserver?sc_version=aaaa&players=3&etc.  Or may be other libraries that are commonly available for http transactions that could be used. 

Scripts 2 & 3 are relatively simple - they basically just dump the data from the mysql database.  For the client script, it could be handly for it to include some demarcation line, like '--- Metaserver Info Start ---' so that the client doesn't have to be able to fully parse http - it just needs enough to make a request and look for that, knowing anything that follows it is the information it wants.

The server component is the hardest part.  Since HTTP is tcp connections, these can time out, may take some time to make the connection, etc.  Simplest way short term would be to have a seperate process that is started (perhaps through popen) that the server talks to, and that other process updates the metaservers.  In a sense, it acts as a proxy, but so long as the popen is done with non blocking IO, never any danger of things getting frozen on the server.  That proxy would try to update all the metaservers it knows about, with some extra logic on what to do when a metaserver isn't responding

There shouldn't be any need for the metaservers to talk to each other.  Since each server will try to talk to all the metaservers, there should be no need.  The client will choose one of the metaservers from the list to use (at random), thus doing load balancing of a form.  The preferred metaserver could also be set in the client.  If the client can not connect to the first metaserver, it would try the next, etc.


IP-Address  : 209.204.178.229
Old Revision: none
New Revision: http://wiki.metalforge.net/doku.php/dev_todo:metaserver_improvements

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list