Open Game Protocol Specification v0.04

TODO: Colors in Host- and Playername

Type Name Dependency Comment
OGP Header (Query)
UINT32 Value: 0xFFFFFFFF
SzString ID Value: "OGP"
VarBitArray HeadFlags Bit 0.0: bAnswer = 0
Bit 0.1: bRequestID
Bit 0.2: bChallengeNumber
Bit 0.3: bSplit
INT32 RequestID bRequestID User definied ID to associate an answer packet with a query. If RequestID = 0 the server will choose a request id.
INT32 ChallengeNumber bChallengeNumber The challenge number to query the server. If the number is wrong or you don't specify one, you'll get one per answer packet. Send a challenge number of 0xFFFFFFFF to request a new.
INT16 MaxBytesPerPacket bSplit Maximum number of bytes a UDP packet may contain. Valid range: 500 - 1500.
UINT8 Type 0 - Banned
1 - None
2 - Default query v1
3 - Rcon
OGP Header (Answer)
UINT32 Value: 0xFFFFFFFF
SzString ID Value: "OGP"
VarBitArray HeadFlags Bit 0.0: bAnswer = 1
Bit 0.1: bRequestID
Bit 0.2: bChallengeNumber
Bit 0.3: bSplit
INT32 RequestID bRequestID User definied ID to associate an answer packet with a query.
INT32 ChallengeNumber bChallengeNumber Your challenge number to query the server.
INT8 SplitPacketCount bSplit
INT8 SplitPacketNo bSplit
UINT8 Type 0 - Banned
1 - None
2 - Default query v1
3 - Rcon
Default Query v1 (Query)
VarBitArray Requests Bit 0.0: bTeamList
Bit 0.1: bPlayerList
Bit 0.2: bRules
Bit 0.3: bAddOnList
Bit 0.4: bLimitList

Bit 1.0: bGameName
Bit 1.1: bServerFlags
Bit 1.2: bMod

Bit 2.0: bHostname
Bit 2.1: bMap
Bit 2.2: bNextMap
Bit 2.3: bGameType

Bit 3.0: bPlayerCount
Bit 3.1: bSlotMax
Bit 3.2: bBotCount
Bit 3.3: bReservedSlots
VarBitArray TeamFields bTeamList Bit 0.0: bTeamName
Bit 0.1: bTeamScore
Bit 0.2: bTeamAveragePing
Bit 0.3: bTeamAverageLoss
Bit 0.4: bTeamPlayerCount
VarBitArray PlayerFields bPlayerList This field indicates which player information will be returned

Bit 0.0: bPlayerFlags
Bit 0.1: bPlayerSlot
Bit 0.2: bPlayerName
Bit 0.3: bPlayerTeam
Bit 0.4: bPlayerClass
Bit 0.5: bPlayerRace

Bit 1.0: bPlayerScore
Bit 1.1: bPlayerFrags
Bit 1.2: bPlayerKills
Bit 1.3: bPlayerDeath
Bit 1.4: bPlayerSuicides
Bit 1.5: bPlayerTeamKills

Bit 2.0: bPlayerID
Bit 2.1: bPlayerGlobalID
Bit 2.2: bPlayerPing
Bit 2.3: bPlayerLoss
Bit 2.4: bPlayerModel
Bit 2.5: bPlayerTime
VarBitArray AddOnFields bAddOnList Bit 0.0: bAddOnFlags
Bit 0.1: bAddOnShortName
Bit 0.2: bAddOnLongName
Bit 0.3: bAddOnVersion
Default Query v1 (Answer)
UINT16 GameID Unique identifier of each game that supports OGP. You find a list of games at www.open-game-protocol.org
VarBitArray Requests See Requests field in query
TEAMLIST TeamList bTeamList Complete team list
PLAYERLIST PlayerList bPlayerList Complete player list
RULESLIST Rules bRules
ADDONLIST AddOnList bAddOnList
LIMITLIST LimitList bLimitList
SzString GameName bGameName Name of the game (e.g. Half-Life)
VarBitArray ServerFlags bServerFlags Bit 0.0: bOSLinux
Bit 0.1: bOSWindows
Bit 0.2: bOSMac
Bit 0.3: bDedicated
Bit 0.4: bProxy
SzString ModName bMod Name of the mod. If ModName is empty the server is running no special modification.
e.g. Counter-Strike
SzString ModDir bMod Directory of the mod. On Quake based games all modifications has their own directory.
e.g. cstrike
SzString Hostname bHostname
SzString MapName bMap
SzString MapFile bMap The file name of the map (without extension). If this field is empty the map file name is equal to the map name.
SzString NextMapName bNextMap
SzString NextMapFile bNextMap The file name of the map (without extension). If this field is empty the map file name is equal to the map name.
SzString GameType bGameType
VarUINT8-32 PlayerCount bPlayerCount
VarUINT8-32 SlotMax bSlotMax
VarUINT8-32 BotCount bBotCount
VarUINT8-32 ReservedSlots bReservedSlots
TEAMLIST
VarUINT8-32 TeamCount Player count in player list.
VarBitArray TeamFields TeamCount != 0 See TeamFields in query
TEAMLISTENTRY x TeamCount TeamList Team list
TEAMLISTENTRY
SzString TeamName bTeamName
SINT32 TeamScore bTeamScore
UINT16 TeamAveragePing bTeamAveragePing
UINT16 TeamAverageLoss bTeamAverageLoss
UINT8 TeamPlayerCount bTeamPlayerCount
UINT8 TeamColor bTeamColor 16 default VGA Colors
PLAYERLIST
VarUINT8-32 PlayerCount Player count in player list.
VarBitArray PlayerFields PlayerCount != 0 See PlayerFields in query
PLAYERLISTENTRY x PlayerCount PlayerList Player list
PLAYERLISTENTRY
VarBitArray PlayerFlags bPlayerFlags Bit 0.0: bAlive
Bit 0.1: bDead
Bit 0.2: bBot

Bit 1.0: bBomp
Bit 1.1: bVIP
UINT8 PlayerSlot bPlayerSlot The server slot that is used by this player.
SzString PlayerName bPlayerName Name of the player
UINT8 PlayerTeamNo bPlayerTeam The number of the team
0xFF - Spectator
SzString PlayerClass bPlayerClass
SzString PlayerRace bPlayerRace
SINT32 PlayerScore bPlayerScore
SINT16 PlayerFrags bPlayerFrags
VarUINT8-32 PlayerKills bPlayerKills
VarUINT8-32 PlayerDeath bPlayerDeath
VarUINT8-32 PlayerSuicides bPlayerSuicides
VarUINT8-32 PlayerTeamKills bPlayerTeamKills
UINT32 PlayerID bPlayerID Server wide unique identifier
SzString PlayerGlobalID bPlayerGlobalID
UINT16 PlayerPing bPlayerPing
UINT16 PlayerLoss bPlayerLoss
SzString PlayerModel bPlayerModel
UINT16 PlayerTime bPlayerTime Time in seconds the player is on the server
RULELIST
VarUINT8-32 RuleCount Rule count in rule list.
RULELISTENTRY x RuleCount RuleList Rule list
RULELISTENTRY
SzString RuleKey
SzString RuleValue
ADDONLIST
VarUINT8-32 AddOnCount
VarBitArray AddOnFields AddOnCount != 0 See AddOnFields in query
ADDONLISTENTRY x AddOnCount AddOnList AddOn list
ADDONLISTENTRY
VarBitArray AddOnFlags bAddOnFlags Bit 0.0: bActive
Bit 0.1: bAntiCheatTool
Bit 0.2: bMutator
Bit 0.3: bAdminTool
SzString AddOnShortName bAddOnShortName
SzString AddOnLongName bAddOnLongName
SzString AddOnVersion bAddOnVersion
LIMITLIST
VarUINT8-32 LimitCount
LIMITLISTENTRY x LimitCount LimitList Limit list
LIMITLISTENTRY
UINT8 LimitType bLimitType Bit 0-6:
0 - Time (in seconds)
1 - Player Score
2 - Round
3 - Team Score
Bit 7: bLimitLeft
VarUINT8-32 Limit
VarUINT8-32 Left bLimitLeft
VarUINT8-32 Type:
UINT8 Len8 8-Bit Length:
Len8 <= 0xFE: VarUINT data structure ends here
Len8 == 0xFF: Use the next 16-Bit length field
UINT16 Len16 Len8 == 0xFF 16-Bit Length:
Len16 <= 0xFFFE: VarUINT data structure ends here
Len16 == 0xFFFF: Use the next 32-Bit length field
UINT32 Len32 Len16 == 0xFFFF 32-Bit Length
VarUINT16-32 Type:
UINT16 Len16 16-Bit Length:
Len16 <= 0xFFFE: VarUINT data structure ends here
Len16 == 0xFFFF: Use the next 32-Bit length field
UINT32 Len32 Len16 == 0xFFFF 32-Bit Length
NString Type:
VarUINT Len Length of string
Char x Len String

SINTx: Signed x bit integer (intel byte order)
UINTx: Unsigned x bit integer (intel byte order)
String: Character String of unkown length
SzString: Null-Terminated string