RCon Protocol

RCon Protocol

Message Format

Data Type

Description

Data Type

Description

Short (2 Bytes)

Message Type

Int (4 Bytes)

Size of Data

Byte Array

Data

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

String Format

Data Type

Description

Data Type

Description

Int (4 Bytes)

Length of String

Byte Array

String 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 Type

Description

Data Type

Description

String

Challenge 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 Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Message 

Int (4 bytes)

Team ID

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

PLAYER_CONNECT

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Player Name

Sent when a player joins the game.

PLAYER_DISCONNECT

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

Sent which a player leaves the game.

MAP_CHANGED

Data Type

Description

Data Type

Description

Int (4 bytes)

Index in Map Rotation.

String

Map Name

Sent when a new map has started.

ROUND_END

Data Type

Description

Data Type

Description

Int (4 bytes)

Winning Team ID.

Sent when a round is over.

MAP_LIST

Data Type

Description

Data Type

Description

String

Map Name

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

TEAM_CHANGED

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

Int (4 bytes)

Team ID

Sent when a player joins a team.

NAME_CHANGED

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Player Name

Sent when a player's name changes.

KILL

Data Type

Description

Data Type

Description

Long (8 Bytes)

Killer Steam ID

Long (8 Bytes)

Victim Steam ID

Sent when a player kills another player.

SUICIDE

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

Sent when a player commits suicide.

PING

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

Int (4 bytes)

Ping

Each player's ping is sent periodically.

RCon Commands (to server)

PASSWORD

Data Type

Description

Data Type

Description

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 Type

Description

Data Type

Description

String

Message

Broadcast a message to all players.

SAY_ALL_BIG

Data Type

Description

Data Type

Description

String

Message

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

SAY

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Message

Display a message to a given player.

CHANGE_MAP

Data Type

Description

Data Type

Description

String

Map Name

Load the given map.

ROTATE_MAP

No Data

Load the next map in the rotation.

KICK_PLAYER

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Reason

Kick the given player.

TEMP_BAN_PLAYER

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Reason

Int (4 Bytes)

Duration in Seconds

Temporarily ban the given player on the game server.

BAN_PLAYER

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

String

Reason

Ban the given player on the game server.

UNBAN_PLAYER

Data Type

Description

Data Type

Description

Long (8 Bytes)

Steam ID

Unban the given player on the game server.