This page documents the EDOTAGCMsg enumeration that defines message identifiers for all communication between the Dota 2 client and Game Coordinator, as well as the message routing and dispatch mechanisms including the override system used for code generation.
The EDOTAGCMsg enumeration serves as the central registry of message identifiers for the Dota 2 protocol. Every message exchanged between the client, Game Coordinator (GC), and game servers is identified by a unique integer value defined in this enumeration. The enumeration is automatically generated from Valve's protocol buffer definitions and contains over 1000 distinct message types organized into logical ranges.
The message IDs are defined in protocol/dota_gcmessages_msgid.pb.go14-88 and range from 7000 (the base) to over 9000. Each message identifier follows a consistent naming convention that indicates the direction and purpose of the message.
Sources: protocol/dota_gcmessages_msgid.pb.go1-88 protocol/dota_gcmessages_msgid.proto1-180
The EDOTAGCMsg type is defined as an int32 enumeration with bidirectional name-to-value mappings. The generated code provides two map structures for efficient lookups:
| Map Variable | Type | Purpose |
|---|---|---|
EDOTAGCMsg_name | map[int32]string | Converts message ID to readable name |
EDOTAGCMsg_value | map[string]int32 | Converts message name to numeric ID |
The mapping between integer IDs and human-readable strings is used by the client to log traffic and by the apigen tool to match requests with responses during code generation.
EDOTAGCMsg Mapping Flow
Sources: protocol/dota_gcmessages_msgid.pb.go11-88 protocol/dota_gcmessages_msgid.proto4-180
Every message sent to or from the Game Coordinator is wrapped with a standard header, CMsgProtoBufHeader. This header provides routing information, session tracking, and error reporting.
| Field | Type | Description |
|---|---|---|
ClientSteamId | uint64 | The SteamID of the client sending/receiving the message protocol/steammessages.pb.go106 |
ClientSessionId | int32 | Current session identifier protocol/steammessages.pb.go107 |
JobIdSource | uint64 | Used for request-response pairing; defaults to 18446744073709551615 protocol/steammessages.pb.go109 |
JobIdTarget | uint64 | Target job ID for replies protocol/steammessages.pb.go110 |
Eresult | int32 | Result code for the operation, defaults to 2 (Fail) protocol/steammessages.pb.go112 |
Sources: protocol/steammessages.pb.go104-116 protocol/steammessages.pb.go119-125
Message identifiers follow strict naming patterns that encode routing information directly in the name. These patterns are reflected in the generated Go code.
| Pattern | Direction | Example | ID |
|---|---|---|---|
k_EMsgGC* | Bidirectional or context-dependent | k_EMsgGCReadyUp | 7070 |
k_EMsgClientToGC* | Client to Game Coordinator | k_EMsgClientToGCPlayerStatsRequest | 8006 |
k_EMsgServerToGC* | Game Server to Game Coordinator | k_EMsgServerToGCRequestStatus | 7026 |
k_EMsgGCToServer* | Game Coordinator to Game Server | k_EMsgGCToServerPingRequest | 7416 |
k_EMsgGCToGC* | Inter-GC communication | k_EMsgGCToGCMatchCompleted | 7186 |
Sources: protocol/dota_gcmessages_msgid.pb.go15-88 protocol/dota_gcmessages_msgid.proto5-180
Many messages follow a request-response pattern where the response message has the same name with a Response suffix. The library's MakeRequest pattern relies on these naming conventions to pair asynchronous GC packets with their calling context.
Request-Response ID Increment Pattern
Sources: protocol/dota_gcmessages_msgid.pb.go17-18 protocol/dota_gcmessages_msgid.pb.go63-64
The message ID space is organized into functional ranges, starting from k_EMsgGCDOTABase = 7000 protocol/dota_gcmessages_msgid.proto5
This range contains fundamental protocol operations:
k_EMsgGCStartFindingMatch, k_EMsgGCStopFindingMatch protocol/dota_gcmessages_msgid.proto13-16k_EMsgGCPracticeLobbyCreate, k_EMsgGCPracticeLobbyJoin protocol/dota_gcmessages_msgid.proto17-24k_EMsgGCJoinChatChannel, k_EMsgGCChatMessage protocol/dota_gcmessages_msgid.proto8-11 protocol/dota_gcmessages_msgid.proto109-110k_EMsgGCGameMatchSignOut, k_EMsgGCGameMatchSignOutResponse protocol/dota_gcmessages_msgid.proto6-7Functional Grouping of Core Messages
Sources: protocol/dota_gcmessages_msgid.pb.go15-88 apigen/snapshot-messages.txt1-151
The apigen tool processes these IDs and uses a heuristic-based system, supported by manual overrides, to generate the final Client API.
Message to API Generation Flow
The generator uses apigen/snapshot-messages.txt and apigen/snapshot-type-list.txt to identify:
CLIENT or the GC apigen/snapshot-messages.txt4-5k_EMsgGCPracticeLobbyLeave to a clean method name like LeaveLobby apigen/snapshot-messages.txt14Sources: apigen/snapshot-messages.txt1-151 apigen/snapshot-type-list.txt1-210
Messages with "SignOut" in their name report end-of-match data.
k_EMsgGCGameMatchSignOut (7004): Match completion data protocol/dota_gcmessages_msgid.proto6k_EMsgGCGameMatchSignOutPermissionRequest (7381): Request to begin sign-out protocol/dota_gcmessages_msgid.proto141Messages prefixed with k_EMsgGCToGC* facilitate communication between Game Coordinator instances.
k_EMsgGCToGCMatchCompleted (7186): Notify other GC instances of match completion protocol/dota_gcmessages_msgid.proto83k_EMsgGCToGCGetUserRank (7236): Query user rank from authoritative GC protocol/dota_gcmessages_msgid.proto100Sources: protocol/dota_gcmessages_msgid.pb.go15-88 protocol/dota_gcmessages_msgid.proto4-180
Refresh this wiki