User:Monster Iestyn/SRB2 Network Documentation

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article.

Stuff possibly to go in SRB2 network documentation and pages related.

Packet types & info

PT_SERVERCFG

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
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. 210 (0xD2) Corresponds to the 2.1 in version 2.1.20.
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. 20 (0x14) Corresponds to the 20 in version 2.1.20.
serverplayer Unsigned 8-bit Integer The number of the server player's node on the server. This is usually the first node, node 0. (?) 0 (0x00) The server player is using node 0.
totalslotnum Unsigned 8-bit Integer The number of node slots used in the server currently (?); this is the highest player number in use plus one. 2 (0x00) There are two node slots in use in the server. The highest player number in use is currently 1.
gametic Unsigned 32-bit Integer The game tic currently being run. This is not the level time in tics, but a separate variable related to ticcmds (?).
clientnode Unsigned 8-bit Integer The number of the node the client recieving the PT_SERVERCFG packet will use when joining the server. This is determined by the server on receiving a PT_CLIENTJOIN packet from the client beforehand, getting the first node that is free (i.e. not used in-game). 1 (0x01) The client will be using node 1 in the server.
gamestate Unsigned 8-bit Integer The number of the current game state; e.g.: 1 indicates a level is being played, 2 indicates the server is currently at an intermission screen. A list of all game states can be found here; the numbers are not given but can be deduced from the order of the named constants. 1 (0x01) A level is currently being played.
playerskins 32-byte array of 8-bit Integers An array containing the skins that all 32 nodes in the server are using, in numeric form. A value of 255 indicates a node is not used. No example
playercolors 32-byte array of 8-bit Integers An array containing the skin colors that all 32 nodes in the server are using, in numeric form. A value of 255 indicates a node is not used. No example
gametype Unsigned 8-bit Integer The current gametype. A list of gametype numbers can be found here. 3 (0x03) 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.
adminplayers 32-byte array of signed 8-bit Integers An array containing the player numbers of up to 32 promoted or logged-in admins on the server. A value of -1 indicates the admin slot is not used. No example
server_context 8-byte String The unique context string for the server. This is randomly generated by the server, containing a mix of uppercase and uppercase letters. No example
varlengthinputs Header for variable length input From this point onwards, player names and netvars (console variables with the CV_NETVAR flag) are saved into the packet. No example

PT_CLIENTCMD/PT_CLIENTMIS

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
client_tic Unsigned 8-bit Integer
resendfrom Unsigned 8-bit Integer
consistancy Signed 16-bit Integer
cmd 8-byte ticcmd_t structure No example

PT_CLIENT2CMD/PT_CLIENT2MIS

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
client_tic Unsigned 8-bit Integer
resendfrom Unsigned 8-bit Integer
consistancy Signed 16-bit Integer
cmd 8-byte ticcmd_t structure No example
cmd2 8-byte ticcmd_t structure No example

PT_NODEKEEPALIVE/PT_NODEKEEPALIVEMIS

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
client_tic Unsigned 8-bit Integer
resendfrom Unsigned 8-bit Integer

PT_SERVERTICS

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
starttic Unsigned 8-bit Integer
numtics Unsigned 8-bit Integer
numslots Unsigned 8-bit Integer
cmds Variable length array of 8-byte ticcmd_t structures The number of ticcmd_t structures sent is numtics × numslots. No example
textcmds Variable amount of extra data The list of net commands sent by each player currently in-game, for each tic sent. No example

PT_SERVERREFUSE

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
reason Variable length String The message giving the reason for the client being refused to join. Length is the length of the message plus one byte for the null terminator – maximum is 255 bytes. "You have been banned\nfrom the server" The client is banned from the server.

PT_SERVERSHUTDOWN/PT_CLIENTQUIT

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example

PT_ASKINFOVIAMS

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
clientaddr 22-byte String The IP address to send PT_SERVERINFO/PT_PLAYERINFO packets back to.
time Unsigned 32-bit Integer Whatever information is put here will be returned in the time section of the PT_SERVERINFO reply. This can be used to check for validity, and check pings. 99035 (0x000182DB) An example of a timestamp that the Master Server Analyzer uses.


PT_RESYNCHEND

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
randomseed Unsigned 32-bit Integer
flagplayer 2-byte array of 8-bit Integers
flagloose 2-byte array of 32-bit Integers
flagflags 2-byte array of 32-bit Integers
flagx 2-byte array of 32-bit Integers
flagy 2-byte array of 32-bit Integers
flagz 2-byte array of 32-bit Integers
ingame Unsigned 32-bit Integer
ctfteam 32-byte array of 32-bit Integers
score 32-byte array of 32-bit Integers
numboxes 32-byte array of 16-bit Integers
totalring 32-byte array of 16-bit Integers
realtime 32-byte array of 32-bit Integers
laps 32-byte array of 8-bit Integers

PT_RESYNCHGET

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
playernum Unsigned 8-bit Integer

PT_FILEFRAGMENT

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
fileid Unsigned 8-bit integer
position Unsigned 32-bit integer The first 31 bits indicate the position of the file fragment in the full file.

The 32nd bit (0x80000000) is set if the fragment sent is the last fragment of the file in position order. The total size of the file can then be calculated as position + size using this file fragment's data when received.

size Unsigned 16-bit integer The size of the file fragment sent, in bytes.
data Header for variable length input No example

PT_TEXTCMD/PT_TEXTCMD2

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
size Unsigned 8-bit Integer The amount of extra data to be sent, in bytes.
extra data Variable amount of extra data A list of net commands to be sent. See below for more info. No example

extra data structure

Data name Data type Description Sample data Sample meaning
id Unsigned 8-bit Integer The type of the net command sent (see Net commands > List of net commands) 1 (0x01) The extra data sent is for a XD_NAMEANDCOLOR net command.
params Variable amount of raw data The net command's parameters buffer, written to an 8-bit integer array. The contents of this vary depending on the type of net command being sent. No example

PT_CLIENTJOIN

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
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. 210 (0xD2) Corresponds to the 2.1 in version 2.1.20.
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. 20 (0x13) Corresponds to the 20 in version 2.1.20.
localplayers Unsigned 8-bit Integer The number of local players requesting to join. If playing with splitscreen mode or with a bot, this is set to 2. Otherwise, this is set to 1.
Note: it is not possible for two players to join a netgame through the same client, so in this context only 1 is valid.
1 (0x01) One local player is requesting to join.
mode Unsigned 8-bit Integer Unused (?) No example

PT_RESYNCHING

Data name Data type Description Sample data Sample meaning
(header) 8 bytes The required header for all SRB2 packets. No example
playernum Unsigned 8-bit Integer
playerstate Unsigned 8-bit Integer
pflags Unsigned 32-bit Integer
panim Unsigned 8-bit Integer
aiming Unsigned 32-bit Integer
currentweapon Signed 32-bit Integer
ringweapons Signed 32-bit Integer
powers 23-byte array of 16-bit Integers
health Signed 32-bit Integer
lives Signed 8-bit Integer
continues Signed 8-bit Integer
scoreadd Unsigned 8-bit Integer
xtralife Signed 8-bit Integer
pity Signed 8-bit Integer
skincolor Unsigned 8-bit Integer
skin Signed 32-bit Integer
normalspeed Signed 32-bit Integer
runspeed Signed 32-bit Integer
thrustfactor Unsigned 8-bit Integer
accelstart Unsigned 8-bit Integer
acceleration Unsigned 8-bit Integer
charability Unsigned 8-bit Integer
charability2 Unsigned 8-bit Integer
charflags Unsigned 32-bit Integer
thokitem Unsigned 32-bit Integer
spinitem Unsigned 32-bit Integer
revitem Unsigned 32-bit Integer
actionspd Signed 32-bit Integer
mindash Signed 32-bit Integer
maxdash Signed 32-bit Integer
jumpfactor Signed 32-bit Integer
speed Signed 32-bit Integer
jumping Unsigned 8-bit Integer
secondjump Unsigned 8-bit Integer
fly1 Unsigned 8-bit Integer
glidetime Unsigned 32-bit Integer
climbing Unsigned 8-bit Integer
deadtimer Signed 32-bit Integer
exiting Unsigned 32-bit Integer
homing Unsigned 8-bit Integer
skidtime Unsigned 32-bit Integer
cmomx Signed 32-bit Integer
cmomy Signed 32-bit Integer
rmomx Signed 32-bit Integer
rmomy Signed 32-bit Integer
weapondelay Signed 32-bit Integer
tossdelay Signed 32-bit Integer
starpostx Signed 16-bit Integer
starposty Signed 16-bit Integer
starpostz Signed 16-bit Integer
starpostnum Signed 32-bit Integer
starposttime Unsigned 32-bit Integer
starpostangle Unsigned 32-bit Integer
maxlink Signed 32-bit Integer
dashspeed Signed 32-bit Integer
dashtime Signed 32-bit Integer
angle_pos Unsigned 32-bit Integer
old_angle_pos Unsigned 32-bit Integer
bumpertime Unsigned 32-bit Integer
flyangle Signed 32-bit Integer
drilltimer Unsigned 32-bit Integer
linkcount Signed 32-bit Integer
linktimer Unsigned 32-bit Integer
anotherflyangle Signed 32-bit Integer
nightstime Unsigned 32-bit Integer
drillmeter Signed 32-bit Integer
drilldelay Unsigned 8-bit Integer
bonustime Unsigned 8-bit Integer
mare Unsigned 8-bit Integer
lastsidehit Signed 16-bit Integer
lastlinehit Signed 16-bit Integer
losstime Unsigned 32-bit Integer
timeshit Unsigned 8-bit Integer
onconveyor Signed 32-bit Integer
hasmo Unsigned 8-bit Integer Does the player currently have a body? Set to 1 if the player's object currently exists in-game, 0 if not.
Note: if the player's object does not exist, the remainder of this structure after this setting should be ignored.
angle Unsigned 32-bit Integer
x Signed 32-bit Integer
y Signed 32-bit Integer
z Signed 32-bit Integer
momx Signed 32-bit Integer
momy Signed 32-bit Integer
momz Signed 32-bit Integer
friction Signed 32-bit Integer
movefactor Signed 32-bit Integer
tics Signed 32-bit Integer
statenum Unsigned 32-bit Integer
flags Unsigned 32-bit Integer
flags2 Unsigned 32-bit Integer
eflags Unsigned 16-bit Integer
radius Signed 32-bit Integer
height Signed 32-bit Integer
scale Signed 32-bit Integer
destscale Signed 32-bit Integer
scalespeed Signed 32-bit Integer

PT_PING

Data name Data type Description
(header) 8 bytes The required header for all SRB2 packets.
pingtable 0 Unsigned 32-bit Integer Player 0's ping
pingtable 1 Unsigned 32-bit Integer Player 1's ping
pingtable 2 Unsigned 32-bit Integer Player 2's ping
pingtable 3 Unsigned 32-bit Integer Player 3's ping
pingtable 4 Unsigned 32-bit Integer Player 4's ping
pingtable 5 Unsigned 32-bit Integer Player 5's ping
pingtable 6 Unsigned 32-bit Integer Player 6's ping
pingtable 7 Unsigned 32-bit Integer Player 7's ping
pingtable 8 Unsigned 32-bit Integer Player 8's ping
pingtable 9 Unsigned 32-bit Integer Player 9's ping
pingtable 10 Unsigned 32-bit Integer Player 10's ping
pingtable 11 Unsigned 32-bit Integer Player 11's ping
pingtable 12 Unsigned 32-bit Integer Player 12's ping
pingtable 13 Unsigned 32-bit Integer Player 13's ping
pingtable 14 Unsigned 32-bit Integer Player 14's ping
pingtable 15 Unsigned 32-bit Integer Player 15's ping
pingtable 16 Unsigned 32-bit Integer Player 16's ping
pingtable 17 Unsigned 32-bit Integer Player 17's ping
pingtable 18 Unsigned 32-bit Integer Player 18's ping
pingtable 19 Unsigned 32-bit Integer Player 19's ping
pingtable 20 Unsigned 32-bit Integer Player 20's ping
pingtable 21 Unsigned 32-bit Integer Player 21's ping
pingtable 22 Unsigned 32-bit Integer Player 22's ping
pingtable 23 Unsigned 32-bit Integer Player 23's ping
pingtable 24 Unsigned 32-bit Integer Player 24's ping
pingtable 25 Unsigned 32-bit Integer Player 25's ping
pingtable 26 Unsigned 32-bit Integer Player 26's ping
pingtable 27 Unsigned 32-bit Integer Player 27's ping
pingtable 28 Unsigned 32-bit Integer Player 28's ping
pingtable 29 Unsigned 32-bit Integer Player 29's ping
pingtable 30 Unsigned 32-bit Integer Player 30's ping
pingtable 31 Unsigned 32-bit Integer Player 31's ping