Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[VANILLA-L:835] Metaservers-HowTo



Date: Wed, 15 April 1998 09:06:09 +0000
From: James Cameron <cameron@stl.dec.com>
Subject: Metaservers File Format

This is the documentation for how to have a new server solicit the
metaserver for players.

It works like this;

	- you set up a .metaservers file with the addresses of the
	  metaservers that should be kept informed,
	
	- when new players arrive on your server, a packet is sent to
	  the metaservers informing them of the current player count,
	
	- periodically, the metaservers are told about current status.

The format of the file is a series of space delimited fields interpreted
using fscanf().  Very primitive.  The code looks for the file in the
current working directory rather than LIBDIR.  This ought to be fixed.

The order and format of the fields is described in ntserv/solicit.c

    /* data items derived from metaservers file */
    char host[32];          /* address of metaserver (DNS)          */
    int port;               /* port of metaserver                   */
    int minimum;            /* minimum update time                  */
    int maximum;            /* maximum update time                  */
    char ours[32];          /* DNS address of server                */
    char type[2];           /* server type code (B/P/C/H/?)         */
    int pport;              /* server main player port (e.g. 2592)  */
    int oport;              /* server observer player port          */
    char comment[32];       /* comment string                       */

The first address should be a numeric IP address in order to avoid DNS
lookup delay on every new player or solicitation update.  Or place a
host name in your /etc/hosts file that corresponds to the metaservers.

Here is the sample_metaservers file ...

metaserver.us.netrek.org 3521 0 60 this.host.name B 2592 3592 open
metaserver.eu.netrek.org 3521 0 60 this.host.name B 2592 3592 open

Replace "this.host.name" with the DNS host name that you want the
metaservers to list the server under.  If you have a name within the
netrek.org domain, use that.  If the metaserver already lists your
server; use the name that the metaserver has for you.

This will cause the metaservers to be updated with game status
information every minute, subject to the limits in the code.

Beware: informing the metaserver more frequently than the limits define
will cause your server to be delisted from the metaserver automatically.
This is handled by program code at the metaserver.

--
James Cameron                                    (cameron@stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800
+
++ Vanilla-l Mailing List ++
To unsubscribe: send "unsubscribe vanilla-l" to majordomo@real-time.com
For more information: http://archives.real-time.com