The protocol package contains every Protocol Buffer message type and enumeration used to communicate with the Dota 2 Game Coordinator (GC). All Go types in this package are code-generated from Valve's .proto source files and are never written by hand.
This page covers the layout of the generated .pb.go files, the message ID system, naming conventions, and the key types consumed by the client and SOCache subsystems. For how message IDs are wired into handler dispatch at runtime, see Communication Flow. For how these files are generated from Valve's proto sources, see Code Generation Pipeline. For how shared object messages flow through the SOCache to consumer code, see SOCache System.
All files in protocol/ belong to Go package protocol protocol/dota_gcmessages_msgid.pb.go5 Each .pb.go file is the compiled output of one Valve-authored .proto source. The table below lists the significant pairs:
Source .proto | Generated .pb.go | Key contents |
|---|---|---|
dota_gcmessages_msgid.proto | dota_gcmessages_msgid.pb.go | EDOTAGCMsg — all Dota GC message IDs (7000+) protocol/dota_gcmessages_msgid.pb.go11 |
gcsdk_gcmessages.proto | gcsdk_gcmessages.pb.go | GCConnectionStatus, CExtraMsgBlock apigen/snapshot-type-list.txt65 |
dota_shared_enums.proto | dota_shared_enums.pb.go | DOTA_GameMode, DOTA_GameState, DOTA_GC_TEAM, EEvent, ERankType |
dota_gcmessages_common.proto | dota_gcmessages_common.pb.go | EDOTAGCSessionNeed, ESpecialPingValue |
dota_match_metadata.proto | dota_match_metadata.pb.go | CDOTAMatchMetadata, CDOTAMatchMetadataFile apigen/snapshot-type-list.txt11-12 |
econ_gcmessages.proto | econ_gcmessages.pb.go | EGCItemMsg — item/economy message IDs (1000–2620) |
Proto Source → Generated Go File
Sources: protocol/dota_gcmessages_msgid.pb.go1-7 protocol/dota_gcmessages_msgid.proto1-4 apigen/snapshot-type-list.txt11-65
EDOTAGCMsgDefined in protocol/dota_gcmessages_msgid.pb.go11 EDOTAGCMsg is an int32 enum that assigns an identity to every Dota 2 GC message. The Dota message space starts at EDOTAGCMsg_k_EMsgGCDOTABase = 7000 protocol/dota_gcmessages_msgid.pb.go14
EGCItemMsgThis is a separate enum covering Steam economy operations (item management, store purchases). It typically uses the range 1000–2620 and is not Dota-specific.
| Range | Enum | File |
|---|---|---|
| 1000 – 2620 | EGCItemMsg | econ_gcmessages.pb.go |
| 7000 – 8200+ | EDOTAGCMsg | dota_gcmessages_msgid.pb.go protocol/dota_gcmessages_msgid.proto5-180 |
For details, see Message Structure and IDs.
Every constant in EDOTAGCMsg carries a prefix that encodes message direction or category:
| Prefix | Direction | Example |
|---|---|---|
k_EMsgGC | Generic / bidirectional | EDOTAGCMsg_k_EMsgGCGameMatchSignOut (7004) protocol/dota_gcmessages_msgid.pb.go15 |
k_EMsgGCPracticeLobby | Lobby operations | EDOTAGCMsg_k_EMsgGCPracticeLobbyCreate (7038) protocol/dota_gcmessages_msgid.pb.go26 |
k_EMsgServerToGC | Game server → GC | EDOTAGCMsg_k_EMsgServerToGCRequestStatus (7026) protocol/dota_gcmessages_msgid.pb.go21 |
Message Direction Model
Sources: protocol/dota_gcmessages_msgid.pb.go14-88 protocol/dota_gcmessages_msgid.proto5-82 apigen/snapshot-messages.txt1-13
This protocol defines the shared object types for party and lobby state, as well as complex metadata structures for match post-processing.
| Type | Role |
|---|---|
CSODOTAParty | Complete party state: member list, game modes, matchmaking state |
CDOTAMatchMetadata | Post-game detailed stats including team kills and player snapshots apigen/snapshot-type-list.txt11 |
CDOTAMatchMetadataFile | Container for match ID and metadata binary payloads apigen/snapshot-type-list.txt12 |
Matchmaking-related enums:
DOTA_GameMode: Match game modes (e.g., All Pick, Captains Mode)EDOTAGCSessionNeed: Client connection status during handshakeFor details, see Match Management Protocol.
The system contains hundreds of shared enumerations covering every aspect of the game state. These types appear as field types across many different message structs.
| Enum | Key values |
|---|---|
EDOTAGCSessionNeed | Handshake status requirements |
ESpecialPingValue | Network quality indicators |
CDOTAMatchMetadata_Team_KillInfo | Kill statistics by type (Player, Tower, Roshan) apigen/snapshot-type-list.txt25 |
For details, see Common Types and Enums.
The following diagram connects specific protocol types to the go-dota2 code layer that uses them directly.
Protocol Type Consumption by Layer
HandleGCPacket in client.go receives a raw GC packet and routes it using values from EDOTAGCMsg protocol/dota_gcmessages_msgid.pb.go11-88CDOTAMatchMetadata apigen/snapshot-type-list.txt11SayHello uses CMsgClientHello to initiate the handshake apigen/snapshot-type-list.txt183Sources: protocol/dota_gcmessages_msgid.pb.go11-88 apigen/snapshot-type-list.txt11-183 apigen/snapshot-messages.txt1-100