This document introduces the go-dota2 library, explaining its purpose as a Dota 2 Game Coordinator (GC) client for Go applications, its relationship to the go-steam library, and the key architectural concepts that enable interaction with Dota 2's backend services. For installation instructions, see Installation and Setup. For hands-on examples, see Basic Usage. For detailed architectural information, see Architecture.
go-dota2 is a Go library that provides a client implementation for the Dota 2 Game Coordinator protocol. It acts as a plugin for the go-steam library, enabling Go applications to communicate with Valve's Dota 2 backend services README.md13 The library handles protocol message serialization, session management, state synchronization, and provides a comprehensive API covering operations exposed by the Dota 2 Game Coordinator README.md26-41
The library is designed to enable developers to build applications that can:
Sources: README.md11-81 go.mod1-13
Understanding go-dota2 requires familiarity with several key concepts that form the foundation of how the library operates:
Sources: README.md43-68 README.md71-76
The Game Coordinator is Valve's backend service that manages Dota 2 game sessions, matchmaking, lobbies, parties, player profiles, and economy operations. It communicates using Protocol Buffer messages over Steam's network infrastructure. The go-dota2 library implements a client that speaks this protocol README.md13
All communication with the Game Coordinator uses Protocol Buffers for message serialization. The library depends on modern protobuf runtimes, including github.com/aperturerobotics/protobuf-go-lite and google.golang.org/protobuf, to handle these messages efficiently go.mod6-18
The SOCache is a specialized caching mechanism for game objects that change state over time. Objects like Lobby, LobbyInvite, Party, and PartyInvite are managed through this system README.md43-48 Applications subscribe to object types and receive events when objects are created, updated, or destroyed.
Example from documentation:
Sources: README.md49-68
The library uses a dynamic API generator (apigen) designed to automatically interpret Valve's naming conventions and convert them into Go code README.md22-25 It matches request IDs to response IDs using heuristics to build a type-safe implementation around the MakeRequest mechanism README.md71-76
| Feature Category | Description | Implementation Status |
|---|---|---|
| GC Session Management | Connection lifecycle, hello handshake, status tracking | ✅ Complete README.md30 |
| Player Profile Operations | Profile fetching, call tracking, statistics | ✅ Complete README.md31 |
| SOCache System | Automatic caching and event propagation for game objects | ✅ Complete README.md32 |
| Lobby Management | Create, join, configure, leave lobbies; team management | ✅ Complete README.md34-36 |
| Party Management | Party creation, invitations, ready checks, matchmaking | ✅ Complete README.md37-39 |
| Chat Interaction | Basic chat operations | ✅ Complete README.md33 |
| Generated API | Comprehensive coverage of GC protocol surface | ✅ Complete README.md40 |
| Typed Events | Event generation for GC notifications | ✅ Complete README.md41 |
go-dota2 is built on top of the go-steam library, which provides the foundational Steam client protocol implementation README.md78-81
Sources: go.mod5-19 README.md78-80
The go-dota2 module declares its dependency on go-steam and protobuf in go.mod5-19:
github.com/paralin/go-steam: Steam client protocol and network transport go.mod7github.com/aperturerobotics/protobuf-go-lite: Optimized Protocol Buffer runtime go.mod6google.golang.org/protobuf: Modern Protocol Buffer runtime go.mod18github.com/sirupsen/logrus: Structured logging used throughout the library go.mod16go-steam.To begin using go-dota2:
Sources: README.md1-81 go.mod1-31
Refresh this wiki