PT_SERVERINFO
PT_SERVERINFO
is a type of packet sent as one of two replies to a PT_ASKINFO
packet, that lists information about the server's running netgame. Its packet type number is 13 (0x0D
in hexadecimal). Apart from being used to display details about the server itself in-game or on the Master Server's online page, the information from this packet type is also used by SRB2 to determine if a client can join it or not. For example, the game checks whether there are too many players on the server for a client to join it or not, and whether the client has all the needed files and can download any files they don't have if not. If a client is able to join the server, but needs to download certain files from it, a PT_REQUESTFILE
packet is sent to the server. Otherwise, if the client does not need to download any files, a PT_CLIENTJOIN
packet is sent.
The other reply to a PT_ASKINFO
packet is PT_PLAYERINFO
.
Packet information
Data name | Data type | Description | Sample data | Sample meaning |
---|---|---|---|---|
(header) | 8 bytes | The required header for all SRB2 packets. | No example | |
_255
|
Unsigned 8-bit Integer | In the old packet, version was the first field. Now that field is always set to 255, to avoid confusing older versions with the new versions and vice-versa.
|
255 (0xFF )
|
This field will always be 255. |
packetversion
|
Unsigned 8-bit Integer | The version of the packet, used to distinguish its format. | 4 (0x4 )
|
The current packet version is 4. |
application
|
16-byte String | The name of the application, used to distinguish source mods. | "SRB2" | The application name used in the vanilla source code. |
version
|
Unsigned 8-bit Integer | The VERSION of SRB2 the game is running. This usually corresponds to the first two digits of the version string.
|
220 (0xDC )
|
Corresponds to the 2.2 in version 2.2.10. |
subversion
|
Unsigned 8-bit Integer | The SUBVERSION of SRB2 the game is running. This usually corresponds to the last digit(s) of the version string.
|
10 (0x0A )
|
Corresponds to the 10 in version 2.2.10. |
numberofplayer
|
Unsigned 8-bit Integer | The current number of players in the game. | 2 (0x02 )
|
Two players are currently in the server. |
maxplayer
|
Unsigned 8-bit Integer | The maximum number of players allowed on the server. | 16 (0x10 )
|
The server is allowing a maximum of only 16 players. |
refusereason
|
Unsigned 8-bit Integer | The reason the client is refused connection, 0 if they are allowed connection. | 1 (0x01 )
|
The client can't connect because joins are disabled. |
gametypename
|
24-byte String | The current gametype's name. | "Match" | The server is playing Match. |
modifiedgame
|
Unsigned 8-bit Integer | Is the game modified or not? Set to 1 if the game is modified, 0 if not. | 0 (0x00 )
|
The game is not modified. |
cheatsenabled
|
Unsigned 8-bit Integer | Are cheats enabled or not? Set to 1 if the game is modified, 0 if not. Note: XSRB2 returns 2 for this, as the "Cheats" designation does not exist. |
1 (0x01 )
|
Cheats are enabled on the server. |
flags
|
Unsigned 8-bit Integer | Currently only stores 2 flags:
|
64 (0x40 )
|
The server is just a dedicated server. |
fileneedednum
|
Unsigned 8-bit Integer | The number of WAD files the server has loaded. This includes files loaded by SRB2 itself at runtime. | 5 (0x05 )
|
The server has 5 WAD files loaded. This is the typical amount of loaded WAD files for a server with no extra files added. |
time
|
Unsigned 32-bit Integer | Returns the same value as the time data in the calling PT_ASKINFO packet. Can be used to check ping and detect corruption.
|
99035 (0x000182DB )
|
The example timestamp given in the PT_ASKINFO query was returned here.
|
leveltime
|
Unsigned 32-bit Integer | The current amount of time spent in the map, in tics. | 350 (0x0000015E )
|
The server has been on the map for exactly ten seconds. |
servername
|
32-byte String | The name of the server. | "SRB2 server" | The server's name is "SRB2 server", which is the default server name. |
mapname
|
8-byte String | The name of the current map the server is on, in the format MAP## .
|
"MAPMB" | The server is playing on Meadow Match Zone. |
maptitle
|
33-byte String | The name of the current map the server is on, as displayed to the players. Combined with actnum and iszone , can be used to show the exact map name.
|
"MEADOW MATCH" | The server is playing on Meadow Match Zone. |
mapmd5
|
16 bytes of raw memory | A hash that identifies the map. | No example | |
actnum
|
Unigned 8-bit Integer | The act of the current map, if applicable. | 0 (0x00 )
|
Meadow Match Zone has no acts. |
iszone
|
Unigned 8-bit Integer | Is the map a "Zone"? | 1 (0x01 )
|
Meadow Match Zone is a "zone". |
fileneeded
|
915 bytes of additional data | A list of all the needed files to join the server. See below for more info. | No example |
fileneeded
structure
The fileneeded
section of the PT_SERVERINFO
packet shows all the files currently added in the game.
Data name | Data type | Description | Sample data | Sample meaning |
---|---|---|---|---|
filestatus
|
Unsigned 8-bit Integer | The lower four bits contain the file's importance: 1 (0x01 ) if downloading the file is necessary to join, 0 (0x00 ) if it isn't.The upper four bits show if the server will send the file: 16 ( 0x10 ) if it will, 0 (0x00 ) if it won't because it's larger than the server's maxsend , 32 (0x20 ) if it won't because downloading is disabled.
|
33 (0x21 )
|
The file is important, but the server has disabled downloading. |
filesize
|
Unsigned 32-bit Integer | Filesize of the file, in bytes. | 76123104 (0x04898BE0 )
|
The file size is 74,339KB. |
filename
|
Variable length String | The filename of the file. Length is the length of the filename plus one byte for the null terminator – maximum is 128 bytes. | "srb2.srb" | The file name is "srb2.srb". |
md5sum
|
16 bytes of raw memory | MD5sum, used to check if the client has the same version of the file. To parse this, read this four bits at a time instead of the traditional eight. | No Example |
Network documentation | [view] | |
Packet types | PT_ASKINFO • PT_SERVERINFO • PT_PLAYERINFO
| |
Other | Net commands |