This document describes the network connection protocol components used for tracking connection state, disconnection reasons, and message metadata. It covers the ENetworkDisconnectionReason enumeration defining over 100 disconnection scenarios, the CMsgProtoBufHeader structure that carries message routing and context information, and the protocol buffer extensions that annotate connection-related messages.
The network connection protocol provides three key mechanisms:
ENetworkDisconnectionReason enum defines specific reasons why a client-server connection was terminated protocol/network_connection.pb.go13-150CMsgProtoBufHeader structure carries routing, session, and job tracking information with every protobuf message protocol/steammessages.pb.go104-116These components work together to enable reliable connection state management, detailed error reporting, and proper message routing between the Dota 2 client and Game Coordinator.
The following diagram maps high-level protocol concepts to the specific generated code entities in the protocol package.
Sources: protocol/steammessages.pb.go20-27 protocol/steammessages.pb.go59-68 protocol/steammessages.pb.go104-116 protocol/network_connection.pb.go13-150 protocol/networkbasetypes.pb.go21-32 protocol/valveextensions.pb.go13-21 protocol/steammessages_unified_base.steamworkssdk.pb.go13-18
The ENetworkDisconnectionReason enum defines 130+ specific reasons why a network connection may be terminated. These reasons are categorized into several groups that indicate the nature and origin of the disconnection.
Commonly encountered disconnection reasons and their meanings:
| Enum Value | Name | Description |
|---|---|---|
| 0 | NETWORK_DISCONNECT_INVALID | Invalid/unspecified reason |
| 1 | NETWORK_DISCONNECT_SHUTDOWN | Normal shutdown |
| 2 | NETWORK_DISCONNECT_DISCONNECT_BY_USER | User initiated disconnect |
| 3 | NETWORK_DISCONNECT_DISCONNECT_BY_SERVER | Server initiated disconnect |
| 4 | NETWORK_DISCONNECT_LOST | Connection lost |
| 6 | NETWORK_DISCONNECT_STEAM_BANNED | Steam ID is banned |
| 7 | NETWORK_DISCONNECT_STEAM_INUSE | Steam ID in use elsewhere |
| 13 | NETWORK_DISCONNECT_STEAM_VACBANSTATE | VAC ban detected |
| 29 | NETWORK_DISCONNECT_TIMEDOUT | Connection timed out |
| 39 | NETWORK_DISCONNECT_KICKED | Kicked from server |
| 69 | NETWORK_DISCONNECT_SERVER_SHUTDOWN | Server shutting down |
| 135 | NETWORK_DISCONNECT_REJECT_SERVERFULL | Server is full |
Sources: protocol/network_connection.pb.go16-150
Steam authentication failures result in specific disconnection codes that indicate the authentication problem:
| Reason | Value | Description |
|---|---|---|
NETWORK_DISCONNECT_STEAM_BANNED | 6 | Steam account is banned |
NETWORK_DISCONNECT_STEAM_INUSE | 7 | Steam ID already in use |
NETWORK_DISCONNECT_STEAM_TICKET | 8 | Invalid Steam auth ticket |
NETWORK_DISCONNECT_STEAM_LOGON | 9 | Steam logon failed |
NETWORK_DISCONNECT_STEAM_VACBANSTATE | 13 | VAC ban detected |
Sources: protocol/network_connection.pb.go22-29
The CMsgProtoBufHeader structure is attached to every protobuf message exchanged between the client and Game Coordinator. It provides essential metadata for message routing, session tracking, and request-response correlation.
| Field | Type | Default | Purpose |
|---|---|---|---|
client_steam_id | uint64 | 0 | Steam ID of the client sending/receiving the message protocol/steammessages.pb.go106 |
client_session_id | int32 | 0 | Session instance ID for the current connection protocol/steammessages.pb.go107 |
source_app_id | uint32 | 0 | Application ID (e.g., 570 for Dota 2) protocol/steammessages.pb.go108 |
job_id_source | uint64 | 18446744073709551615 | Job ID for request-response correlation (request side) protocol/steammessages.pb.go109 |
job_id_target | uint64 | 18446744073709551615 | Job ID for request-response correlation (response side) protocol/steammessages.pb.go110 |
eresult | int32 | 2 | Error result code (EResult enum) protocol/steammessages.pb.go112 |
gc_msg_src | GCProtoBufMsgSrc | Unspecified | Message source type protocol/steammessages.pb.go114 |
Sources: protocol/steammessages.pb.go104-116 protocol/steammessages.pb.go119-125
The job_id_source and job_id_target fields enable request-response message correlation. The default value for these fields is 18446744073709551615 (Uint64 Max).
Sources: protocol/steammessages.pb.go109-110 protocol/steammessages.pb.go154-166
The GCProtoBufMsgSrc enum identifies the origin of a message for internal GC routing and security validation.
| Value | Name | Description |
|---|---|---|
| 1 | GCProtoBufMsgSrc_FromSystem | From system-level service |
| 2 | GCProtoBufMsgSrc_FromSteamID | From authenticated Steam user |
| 3 | GCProtoBufMsgSrc_FromGC | From another Game Coordinator |
| 5 | GCProtoBufMsgSrc_SpoofedSteamID | Spoofed Steam ID (testing/admin) |
Sources: protocol/steammessages.pb.go59-68
The network connection protocol defines protocol buffer extensions that annotate disconnection reason enum values with additional metadata. These are defined as ExtensionInfo objects in the generated Go code.
E_NetworkConnectionToken: Localization token for user-facing message protocol/network_connection.pb.go203E_NetworkConnectionDetailToken: Localization token for detailed explanation protocol/network_connection.pb.go205E_AllowedFromClient: Whether client can send this disconnect reason protocol/network_connection.pb.go207Sources: protocol/network_connection.pb.go202-218
In addition to connection-specific extensions, the codebase uses metadata defined in unified base messages to handle execution sites and service descriptions.
The EProtoDebugVisiblity enum defines where protocol message data is allowed to be printed in logs:
k_EProtoDebugVisibility_Always (0) protocol/valveextensions.pb.go16k_EProtoDebugVisibility_Server (70) protocol/valveextensions.pb.go17k_EProtoDebugVisibility_ValveServer (80) protocol/valveextensions.pb.go18k_EProtoDebugVisibility_GC (90) protocol/valveextensions.pb.go19k_EProtoDebugVisibility_Never (100) protocol/valveextensions.pb.go20The EProtoExecutionSite enum tracks where unified services are executed:
k_EProtoExecutionSiteUnknown (0) protocol/steammessages_unified_base.steamworkssdk.pb.go16k_EProtoExecutionSiteSteamClient (3) protocol/steammessages_unified_base.steamworkssdk.pb.go17Sources: protocol/valveextensions.pb.go13-21 protocol/steammessages_unified_base.steamworkssdk.pb.go13-18 protocol/steammessages_unified_base.steamworkssdk.proto30-33
The connection lifecycle is tracked using the SignonStateT enumeration, which defines the progression from initial connection to full synchronization.
| State | Value | Description |
|---|---|---|
SIGNONSTATE_NONE | 0 | Initial state protocol/networkbasetypes.pb.go24 |
SIGNONSTATE_CONNECTED | 2 | TCP/UDP connection established protocol/networkbasetypes.pb.go26 |
SIGNONSTATE_NEW | 3 | Starting signon handshake protocol/networkbasetypes.pb.go27 |
SIGNONSTATE_SPAWN | 5 | Entities are spawning protocol/networkbasetypes.pb.go29 |
SIGNONSTATE_FULL | 6 | Fully connected and synchronized protocol/networkbasetypes.pb.go30 |
Sources: protocol/networkbasetypes.pb.go21-32
The protocol defines low-level network messages used for synchronization and state updates between the client and server.
Sources: protocol/networkbasetypes.pb.go72-88 protocol/networkbasetypes.pb.go21-32
Refresh this wiki