Difference between revisions of "Directory Game Server Protocol"
(major overhaul (someone want to add the bit about subgame using the ping packets every 4min or something? i forgot the specifics)) |
m (→Validating the zone name: the grammer must cannot exist) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
− | [[Zone|Game | + | [[Zone|Game Servers]] such as [[subgame2]] and [[ASSS]] register their prescence on [[Directory server|Directory Servers]]. This page describes the portion of the '''directory server protocol''' that game servers use. |
− | This system | + | This system uses UDP packets, most commonly over port 4991. Maximum length of the packet is only limited to the directory server software itself, so it varies from each application. The specific lengths of most fields are static, with the zone description field being the only value that varies its length. |
== Protocol == | == Protocol == | ||
Line 14: | Line 14: | ||
6 2 player count | 6 2 player count | ||
8 2 saving scores? (boolean) | 8 2 saving scores? (boolean) | ||
− | + | 10 4 version (set this to 134) | |
14 32 zone name (null terminated) | 14 32 zone name (null terminated) | ||
46 16 password (null terminated) | 46 16 password (null terminated) | ||
62 32 reserved (suggested to set this to 0) | 62 32 reserved (suggested to set this to 0) | ||
− | + | 94 ? description (must be null terminated) | |
</pre> | </pre> | ||
− | + | == Notes on Priit's dirserv == | |
− | + | Descriptions are recorded to the stats file with a max length of 490 bytes. The reserved field can be filled with any random data, as the directory server ignores this field completely. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Notes on | ||
− | Descriptions are recorded to the stats file with a max length of 490 bytes. | ||
== Notes on Catid's dirserv == | == Notes on Catid's dirserv == | ||
− | |||
=== Validating the packet === | === Validating the packet === | ||
* The length of the packet must be greater than 95/0×5F bytes. Basically this means the description can be blank but must be null terminated. | * The length of the packet must be greater than 95/0×5F bytes. Basically this means the description can be blank but must be null terminated. | ||
* The first 4 bytes (the IP field) must be zeroed. | * The first 4 bytes (the IP field) must be zeroed. | ||
+ | * The reserved field must be zeroed. | ||
* The name, password and description must be null terminated. | * The name, password and description must be null terminated. | ||
* The "save scores" field must be either 0 or 1. | * The "save scores" field must be either 0 or 1. | ||
=== Validating the zone name === | === Validating the zone name === | ||
− | * | + | * Name must be at least one character long. |
− | * | + | * First and last characters must not be a space. |
− | * No more than | + | * No more than one space in a row. |
− | * | + | * Only ASCII characters between ‘ ‘ [0x20] and ‘~’ [0x7E], inclusive. |
− | + | ||
+ | == Notes on zone.dat == | ||
+ | Due to the format of zone.dat used to store your favourite zones, zone names should not begin with '#' [0x23] or contain any ',' [0x2C]. | ||
== See also == | == See also == | ||
* [http://cypherjf.sscentral.com/articles/game-server-to-directory-server/ CypherJF's original document] | * [http://cypherjf.sscentral.com/articles/game-server-to-directory-server/ CypherJF's original document] | ||
* [http://web.archive.org/web/*/http://www4.ncsu.edu/~rniyenga/subspace/old/dprotocol.html Hammuravi's page] | * [http://web.archive.org/web/*/http://www4.ncsu.edu/~rniyenga/subspace/old/dprotocol.html Hammuravi's page] | ||
− | * ASSS | + | * [http://asss.yi.org/asss/ ASSS Source]: src/directory.c |
* [[Directory Client Protocol]] | * [[Directory Client Protocol]] | ||
[[Category: Protocol]] | [[Category: Protocol]] |
Latest revision as of 09:36, 12 January 2007
Contents
Introduction
Game Servers such as subgame2 and ASSS register their prescence on Directory Servers. This page describes the portion of the directory server protocol that game servers use.
This system uses UDP packets, most commonly over port 4991. Maximum length of the packet is only limited to the directory server software itself, so it varies from each application. The specific lengths of most fields are static, with the zone description field being the only value that varies its length.
Protocol
g2d register game server offset size comment 0 4 ip (leave this set to 0?) 4 2 port 6 2 player count 8 2 saving scores? (boolean) 10 4 version (set this to 134) 14 32 zone name (null terminated) 46 16 password (null terminated) 62 32 reserved (suggested to set this to 0) 94 ? description (must be null terminated)
Notes on Priit's dirserv
Descriptions are recorded to the stats file with a max length of 490 bytes. The reserved field can be filled with any random data, as the directory server ignores this field completely.
Notes on Catid's dirserv
Validating the packet
- The length of the packet must be greater than 95/0×5F bytes. Basically this means the description can be blank but must be null terminated.
- The first 4 bytes (the IP field) must be zeroed.
- The reserved field must be zeroed.
- The name, password and description must be null terminated.
- The "save scores" field must be either 0 or 1.
Validating the zone name
- Name must be at least one character long.
- First and last characters must not be a space.
- No more than one space in a row.
- Only ASCII characters between ‘ ‘ [0x20] and ‘~’ [0x7E], inclusive.
Notes on zone.dat
Due to the format of zone.dat used to store your favourite zones, zone names should not begin with '#' [0x23] or contain any ',' [0x2C].
See also
- CypherJF's original document
- Hammuravi's page
- ASSS Source: src/directory.c
- Directory Client Protocol