Directory Game Server Protocol
ABSTRACT: This document will explain the details needed to send zone data to the directory server.
Some background information, this system relies on the UDP protocol, port 4991. Max length of the packet is only limited to the directory server software itself (so it varies from each application). However, the specific lengths of fields are pretty much final, the zone description should be the only length that varies. The following is based off examination of the open-source Directory Server by Catid; and discussions with him about this topic.
Offset Length Description =================================== 0Ã—00 [ 0] 4 IP address. (Must be NULL: 00 00 00 00) 0Ã—04 [ 4] 2 Server Port 0Ã—06 [ 6] 2 Population 0Ã—08 [ 8] 2 Scoring? (0Ã—00 - no; 0Ã—01 - yes) 0Ã—0A [ 10] 4 Version (134) 0Ã—0E [ 14] 32 Zone Name (31 characters, null-terminated.) Must also be a valid name. 0Ã—2E [ 46] 16 Zone Password (15 characters, null-terminated.) 0Ã—3E [ 62] 32 Unknown NULL field. (*** see discussion) 0Ã—5E [ 94] VARIES Zone Description (varied length, null-terminated.)
- Offsets are given in HEX [ DEC].
- 32 byte NULL field Discussion - I was surprised to see this in the validation function of Catidâ€™s directory server. After some discussion with him, he assures me there is a 32 length NULL field. As of Catids Distributed Directory Server build 4, these 32 bytes MUST BE NULL. It is enforced. However, after some testing done by 2dragons - having non-null bytes in this section does not affect the directory server writen by PriitK. Later thoughts were that VIE may have planned on adding more fields into the directory server protocol; but never got around to it.
- Further Discussion - PriitKâ€™s directory server records descriptions to the stats file with a max length of 490 bytes.
- Validation - The following are conditions that I took apart from Catidâ€™s validating function as well.
The length of the packet must be greater than 0Ã—5F The first 4 bytes must be null, or zero. The last byte of the packet must be NULL (0Ã—00) The byte[0Ã—2D] must be 0Ã—00 The byte[0Ã—3D] must be 0Ã—00 The byte[0Ã—08] must be either 0Ã—00, or 0Ã—01 The byte[0Ã—3E] to byte[0Ã—5D]
- Validating Name ***
There are also conditions on what determines a validName, etc. This part may or may not be correct. I just threw it in here quickly.
Catids Directory Server says: validName would be: len(name) > 0 no leading spaces no more than 1 space in a row Any character between â€˜ â€˜ and â€˜~â€™ No trailing spaces