How vtrider/statsgate works
Statsgate is a game-session statistics recorder for BZCC. Its documented main workflow is to launch the freestanding client while the game is open, capture mission events into a protobuf session, and save the session locally; console commands expose control and configuration. The tree also contains DLL- and Lua-hosted client entry points and mission-hook support. Source excerpts establish the entry-point and recorder relationships, but do not show the full serialization and file-writing implementation, so those links are documented rather than inferred from unsampled code.
Main entry points: stat_client.cpp Stat client · freestanding_client.cpp Freestanding entry · dll_client.cpp DLL entry · command.h Command registry
Components 17
Client runtime
- Freestanding entry
statsgate/src/freestanding_client.cpp - DLL entry
statsgate/src/dll_client.cpp - Lua entry
statsgate/src/lua_client.cpp - Singleton guard
src/dllmain.cpp - Thread guard
src/thread_guard.cpp
Mission capture
- Stat client
src/stat_client.cpp - Recorder interface
src/stat_client.h - Mission hooks
src/mission_hook.cpp
Stat events
- Session schema
statsgate.proto - Protobuf messages
src/statsgate.pb.h - Saved sessions
src/stat_client.cpp
Client interfaces
- Console commands
src/command.cpp - Command registry
src/command.h
Other components
- Player
- Stats launcher
- BZCC game
- Stats consumer
Connections 17
- Stats launcher → Freestanding entry: starts client
README.md - Freestanding entry → Stat client: creates
statsgate/src/freestanding_client.cpp - Freestanding entry → Thread guard: guards setup
statsgate/src/freestanding_client.cpp - DLL entry → Singleton guard: checks instance
- DLL entry → Stat client: creates
statsgate/src/dll_client.cpp - Lua entry → Stat client: creates
statsgate/src/lua_client.cpp - Stat client → Recorder interface: implements
src/stat_client.h - Stat client → Mission hooks: applies hooks
src/stat_client.cpp - Stat client → Command registry: registers handlers
src/stat_client.cpp - Command registry → Console commands: dispatches
src/command.cpp - BZCC game → Mission hooks: provides callbacks
- BZCC game → Stat client: supplies game state
src/stat_client.cpp - Stat client → Protobuf messages: records events
src/stat_client.cpp - Session schema → Protobuf messages: defines messages
src/statsgate.pb.h - Stat client → Saved sessions: saves sessions
README.md - Saved sessions → Stats consumer: contributes stats
README.md - Player → Stats launcher: starts recording
README.md