Open Game Protocol Specification v0.05

1. What is OGP?

OGP is a protocol to query game information from any game server. There exists many game protocols on the net that have its assets and drawbacks. OGP is designed to combine all advantages to clean up the jungle of game protocols. It meets all requirements for an universal game protocol, that can be used (or extended to be used) by every game.

2. Features

3. Protocol

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 = 0

The server ignores the query if bAnswer or bSplit is set.
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.
VarUINT8-32 Type 0x00 - None
0x01 - Default query v1
0x02 - (Rcon)
0xFF - Error (only for answer)
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 If bChallengeNumber is set your old challenge number was invalid and this field contains your new number. The answer for your request is NOT following this header but a copy of your query. So you can simple clear the bAnswer flag and send it back.
INT8 SplitPacketCount bSplit
INT8 SplitPacketNo bSplit
UINT8 Type 0x00 - None
0x01 - Default query v1
0x02 - (Rcon)
0xFF - Error (only for answer)
Error (Answer)
VarUINT ErrorValue 0 - Banned
1 - Invalid Type
2 - Query too short
3 - Invalid Value
Default Query v1 (Query)
VarBitArray Requests Bit 0.0: bColoredNames

Bit 1.0: bTeamList
Bit 1.1: bPlayerList
Bit 1.2: bRules
Bit 1.3: bAddOnList
Bit 1.4: bLimitList

Bit 2.0: bGameName
Bit 2.1: bServerFlags
Bit 2.2: bMod
Bit 2.3: bConnectPort

Bit 3.0: bHostName
Bit 3.1: bMap
Bit 3.2: bNextMap
Bit 3.3: bGameType

Bit 4.0: bPlayerCount
Bit 4.1: bSlotMax
Bit 4.2: bBotCount
Bit 4.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
UINT16 ConnectPort bConnectPort Connect Port of the game server
SzString HostName bHostName
StringColorInfo HostNameColor bHostName AND bColoredNames
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
StringColorInfo TeamNameColor bTeamName AND bColoredNames
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
StringColorInfo PlayerNameColor bPlayerName AND bColoredNames
UINT8 PlayerTeamNo bPlayerTeam The number of the team
0xFE - Not Assinged
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-3:
0 - Time (in seconds)
1 - Player Score
2 - Round
3 - Team Score
Bit 5-6: Reserved
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:
VarUINT8-32 Len Length of string
Char x Len String
VarBitArray Type:
UINT8 Byte[n] n=0 or Bit 7 of Byte[n-1] is set The type begins with n=0 (Byte[0]).
This is the n+1th byte of bit array. Bits 0-6 are free to use and are indicated by "n.x". If Bit 7 is not set VarBitArray ends here and all other bits are adopted to 0. Otherwise it follows Byte[n+1] of same format.
StringColorInfo Type:
VarUINT8-32 ColorCount
StringColorInfoEntry x ColorCount Data
StringColorInfoEntry Type:
VarUINT8-32 DeltaPosition
UINT8 ColorValue 0x00-0x0F: Change text color to ColorValue (VGA Colors)
0x10: Reset text color to default
0x20-0x2F: Change background color to ColorValue-16 (VGA Colors)
0x30: Reset background color to defaul
0x40: Toggle bold
0x41: Toggle underlined
0x42: Toggle cursive

0x90: Use 16-Bit text color
0x91: Use 16-Bit background color
UINT16 ColorValue16 ColorValue >= 0x90 OR ColorValue <= 0x9F 16 Bit color value in 5-6-5 RGB format

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


OGP designed by Timo Stripf and Tobias Oetzel

Copyright (c) 2003 by Timo Stripf