PT_PLAYERINFO

From SRB2 Wiki
Jump to: navigation, search

PT_PLAYERINFO is a type of packet sent as one of two replies to a PT_ASKINFO packet, that lists information about the players in the server's running netgame. Its packet type number is 14 (0x0E in hexadecimal). This type of packet is used only by the Master Server's online page; SRB2 itself ignores all packets of this type if it receives them.

The other reply to a PT_ASKINFO packet is PT_SERVERINFO.

Packet information

Data name Data type Description
(header) 8 bytes The required header for all SRB2 packets.
plrinfo 0 36-byte player info structure Information on node 0, the server node.
plrinfo 1 36-byte player info structure Information on node 1.
plrinfo 2 36-byte player info structure Information on node 2.
plrinfo 3 36-byte player info structure Information on node 3.
plrinfo 4 36-byte player info structure Information on node 4.
plrinfo 5 36-byte player info structure Information on node 5.
plrinfo 6 36-byte player info structure Information on node 6.
plrinfo 7 36-byte player info structure Information on node 7.
plrinfo 8 36-byte player info structure Information on node 8.
plrinfo 9 36-byte player info structure Information on node 9.
plrinfo 10 36-byte player info structure Information on node 10.
plrinfo 11 36-byte player info structure Information on node 11.
plrinfo 12 36-byte player info structure Information on node 12.
plrinfo 13 36-byte player info structure Information on node 13.
plrinfo 14 36-byte player info structure Information on node 14.
plrinfo 15 36-byte player info structure Information on node 15.
plrinfo 16 36-byte player info structure Information on node 16.
plrinfo 17 36-byte player info structure Information on node 17.
plrinfo 18 36-byte player info structure Information on node 18.
plrinfo 19 36-byte player info structure Information on node 19.
plrinfo 20 36-byte player info structure Information on node 20.
plrinfo 21 36-byte player info structure Information on node 21.
plrinfo 22 36-byte player info structure Information on node 22.
plrinfo 23 36-byte player info structure Information on node 23.
plrinfo 24 36-byte player info structure Information on node 24.
plrinfo 25 36-byte player info structure Information on node 25.
plrinfo 26 36-byte player info structure Information on node 26.
plrinfo 27 36-byte player info structure Information on node 27.
plrinfo 28 36-byte player info structure Information on node 28.
plrinfo 29 36-byte player info structure Information on node 29.
plrinfo 30 36-byte player info structure Information on node 30.
plrinfo 31 36-byte player info structure Information on node 31.

plrinfo structure

As shown above, the plrinfo structure is repeated in the packet 32 times, once for each node. Info on all 32 nodes are sent regardless of whether or not they are all occupied; it is up to the client to parse the structure and ignore nodes with no info. Due to the way SRB2 handles nodes, which allows an unoccupied "hole" of node(s) between occupied nodes, this is necessary.

Data name Data type Description Sample data Sample meaning
node Unsigned 8-bit Integer The node of the player. A value of 255 indicates an empty slot, which means the rest of this structure should be ignored. 0 (0x00) The info we are getting is related to node 0, the server's node.
name 22-byte String The in-game name of the player. "Inuyasha" The player's name is "Inuyasha".
address 4-byte array of 8-bit Integers Unused – This field formerly gave the IP address of the player, condensed into four 8-bit unsigned integers. However, as of the current version of SRB2, this field will always be {0, 0, 0, 0} ({0x00, 0x00, 0x00, 0x00}). No example
team Unsigned 8-bit Integer The team that the player is currently on. 255 always indicates a spectator. 0 indicates the player is playing on a gametype that does not use teams,
1 indicates the player is on the Red Team, and 2 indicates the player is on the Blue Team.
255 (0xFF) The player in question is a spectator.
skin Unsigned 8-bit Integer The skin that the player is using, in numeric form. 0 (0x00) The player is using Sonic, which is usually the skin loaded into slot 0.
data Unsigned 8-bit Integer The first five bits indicate the player's current skin color, in numeric form. This will be any number from 1 (0x01) to 25 (0x19).
The sixth bit (0x20) is set when the player is IT! in Tag.
The seventh bit (0x40) is set if the player has a flag in CTF.
The eighth bit (0x80) is set if the player is super.
18 (0x12) The player's color is red. The player is not IT!, does not have a flag,
and is not super.
score Unsigned 32-bit Integer The player's score. 0 (0x00000000) The player has a score of 0, which is typical of a spectator.
timeinserver Unsigned 16-bit Integer The time that the player has been in the server, in seconds. 462 (0x01CE) The player has been in the server for 7 minutes and 42 seconds.
  Network documentation [view]
Packet types PT_ASKINFOPT_SERVERINFOPT_PLAYERINFO
Other Net commands