Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Message Format

Data TypeDescription
Short (2 Bytes)Message Type
Int (4 Bytes)Size of Data
Byte ArrayData

All messages are sent in this format.  The Data depends on the Message Type.  See Below.

String Format

Data TypeDescription
Int (4 Bytes)Length of String
Byte ArrayString encoded in UTF-8

This format is used for the String data types below.

Message Types

 

SERVER_CONNECT = 0
SERVER_CONNECT_SUCCESS = 1
PASSWORD = 2
PLAYER_CHAT = 3
PLAYER_CONNECT = 4
PLAYER_DISCONNECT = 5
SAY_ALL = 6
SAY_ALL_BIG = 7
SAY = 8
MAP_CHANGED = 9
MAP_LIST = 10
CHANGE_MAP = 11
ROTATE_MAP = 12
TEAM_CHANGED = 13
NAME_CHANGED = 14
KILL = 15
SUICIDE = 16
KICK_PLAYER = 17
TEMP_BAN_PLAYER = 18
BAN_PLAYER = 19
UNBAN_PLAYER = 20
ROUND_END = 21
PING = 22

Game Events (from server)

SERVER_CONNECT

Data TypeDescription
StringChallenge String

Sent when a connection attempt is received.  Use the challenge string and send a PASSWORD message.

SERVER_CONNECT_SUCCESS

No Data

Sent after the password has been accepted.

PLAYER_CHAT

Data TypeDescription
Long (8 Bytes)Steam ID
StringMessage 
Int (4 bytes)Team ID

Sent when a player types a message in the in-game chat.

PLAYER_CONNECT

Data TypeDescription
Long (8 Bytes)Steam ID
StringPlayer Name

Sent when a player joins the game.

PLAYER_DISCONNECT

Data TypeDescription
Long (8 Bytes)Steam ID

Sent which a player leaves the game.

MAP_CHANGED

Data TypeDescription
Int (4 bytes)Index in Map Rotation.
StringMap Name

Sent when a new map has started.

ROUND_END

Data TypeDescription
Int (4 bytes)Winning Team ID.

Sent when a round is over.

MAP_LIST

Data TypeDescription
StringMap Name

The map list is sent one time after SERVER_CONNECT_SUCCESS.  Each map name is sent as an individual message.  

TEAM_CHANGED

Data TypeDescription
Long (8 Bytes)Steam ID
Int (4 bytes)Team ID

Sent when a player joins a team.

NAME_CHANGED

Data TypeDescription
Long (8 Bytes)Steam ID
StringPlayer Name

Sent when a player's name changes.

KILL

Data TypeDescription
Long (8 Bytes)Killer Steam ID
Long (8 Bytes)Victim Steam ID

Sent when a player kills another player.

SUICIDE

Data TypeDescription
Long (8 Bytes)Steam ID

Sent when a player commits suicide.

PING

Data TypeDescription
Long (8 Bytes)Steam ID
Int (4 bytes)Ping

Each player's ping is sent periodically.

RCon Commands (to server)

PASSWORD

Data TypeDescription
String

Password concatenated with the challenge string (from SERVER_CONNECT).

Encoded using SHA-1 and sent as a 40 character hex string.

Send after receiving SERVER_CONNECT message.  

SAY_ALL

Data TypeDescription
StringMessage

Broadcast a message to all players.

SAY_ALL_BIG

Data TypeDescription
StringMessage

Broadcast a message to all players in a way that will catch their attention.

SAY

Data TypeDescription
Long (8 Bytes)Steam ID
StringMessage

Display a message to a given player.

CHANGE_MAP

Data TypeDescription
StringMap Name

Load the given map.

ROTATE_MAP

No Data

Load the next map in the rotation.

KICK_PLAYER

Data TypeDescription
Long (8 Bytes)Steam ID
StringReason

Kick the given player.

TEMP_BAN_PLAYER

Data TypeDescription
Long (8 Bytes)Steam ID
StringReason
Int (4 Bytes)Duration in Seconds

Temporarily ban the given player on the game server.

BAN_PLAYER

Data TypeDescription
Long (8 Bytes)Steam ID
StringReason

Ban the given player on the game server.

UNBAN_PLAYER

Data TypeDescription
Long (8 Bytes)Steam ID

...