How steamre/steamkit works
Project type and purpose
• Project type: an open-source, modular .NET library (SteamKit2) for interfacing with Valve’s Steam network.
• Purpose: expose a simple, extensible API for .NET applications to authenticate, send/receive protocol messages, and consume Steam WebAPI endpoints.
High-level architectural components
a. Consumer Application (your code or sample apps)
b. SteamKit2 Library
• Core API (SteamClient)
• Message Definitions (Base/Generated)
• Protocol Handlers (Steam/Handlers)
• Networking Layer (Networking/Steam3)
• WebAPI Client (Steam/WebAPI)
• Supporting Modules
• Types (SteamIDs, Manifests, JobIDs, etc.)
• Utilities (Crypto, LZMA, Logging, Helpers)
c. External Dependencies
• .NET 8.0 Runtime
• Protobuf (for message serialization)
• Steam network endpoints (TCP, UDP, WebSocket)
Component relationships and data flow
• The Consumer App instantiates SteamClient (Core API).
• SteamClient uses Configuration → CallbackMgr → AsyncJobManager.
• SteamClient dispatches/receives ClientMsg through Protocol Handlers.
• Handlers package/unpackage messages defined in Base/Generated (Protobuf).
• Serialized messages flow into Networking Layer which manages connections (TCP/UDP/WebSocket) to Steam servers.
• Responses traverse back up: Networking → Deserialization → Handler callbacks → Consumer callbacks.
• WebAPI Client component can be invoked directly by Consumer or by SteamClient for HTTP REST calls.
Key architectural patterns and design principles
• Modular layering: clear separation of Core API, Message Definitions, Handlers, Networking, and Utils.
• Plug-in style extensibility: add new handlers under Steam/Handlers without modifying core.
• Asynchronous job/callback model: AsyncJobManager and CallbackMgr decouple network I/O from application logic.
• Generated code for protocol messages (Protobuf) ensures consistency and reduces manual coding.
• Dependency injection points: configuration builders, machine info providers.