How cagrianilokumus/squadreader works
sqreader is a read-only Squad server observer that captures live game state, records matches, computes player statistics/ELO, and serves replay and stats views. Its main workflow runs from an administrator starting the agent, through process-memory sampling and match recording, to browser replay. The README documents the two-tier capture cadence, compressed replay format, local persistence, and optional central push. Source excerpts are partial, so links between unsampled backend orchestration and subsystems are limited to documented behavior.
Main entry points: cli.py CLI and orchestration · App.tsx Viewer application · httpsrv.py HTTP service · ingest_client.py Central ingest client
Components 24
Memory capture
- Process discovery
sqreader/scanner.py - Process memory access
sqreader/mem.py - Unreal object reader
sqreader/ue/uobject.py - Game snapshot builder
sqreader/squad/snapshot.py - Position sampler
sqreader/squad/possample.py - Full-frame worker
sqreader/squad/buildworker.py
Recording and stats
- Match recorder
sqreader/recorder.py - Recording lifecycle
sqreader/recording_lifecycle.py - Compressed replay files
sqreader/sqrx.py - Stats and ELO
sqreader/stats.py
Agent serving
- CLI and orchestration
sqreader/cli.py - HTTP service
sqreader/httpsrv.py
Replay viewer
- Viewer application
frontend/src/App.tsx - Replay loading
frontend/src/api/replay.ts - Replay playback
frontend/src/api/playback.ts - Viewer state
frontend/src/state/viewerStore.ts - Live map rendering
frontend/src/canvas/MapCanvas.tsx - Kill feed
frontend/src/killfeed/useKillFeed.ts - Player stats view
frontend/src/ui/PlayerStats.tsx
External integrations
- Squad server process
- Optional central platform
- Central ingest client
sqreader/ingest_client.py
Other components
- Server administrator
- Viewer user
Connections 30
- Server administrator → CLI and orchestration: starts agent
- CLI and orchestration → Process discovery: discovers process
- Process discovery → Squad server process: selects process
- Game snapshot builder → Process memory access: reads memory
- Unreal object reader → Process memory access: reads objects
- Game snapshot builder → Unreal object reader: resolves objects
- Position sampler → Process memory access: samples positions
- Full-frame worker → Game snapshot builder: builds frames
- CLI and orchestration → Full-frame worker: starts worker
- CLI and orchestration → Position sampler: runs sampler
- CLI and orchestration → Match recorder: records matches
- Match recorder → Compressed replay files: writes replay
- CLI and orchestration → Recording lifecycle: manages matches
- CLI and orchestration → Stats and ELO: computes stats
- CLI and orchestration → HTTP service: starts service
- Viewer user → Viewer application: opens viewer
- Viewer application → Replay loading: loads replay
- Replay loading → HTTP service: requests replay
- HTTP service → Compressed replay files: serves replay
- Viewer application → Replay playback: starts playback
- Replay playback → Viewer state: updates playhead
- Viewer application → Viewer state: reads state
- Viewer application → Live map rendering: renders map
- Viewer application → Kill feed: activates feed
- Viewer application → Player stats view: shows stats
- Player stats view → HTTP service: requests stats
- HTTP service → Stats and ELO: reads statistics
- CLI and orchestration → Central ingest client: pushes finished matches
- Central ingest client → Stats and ELO: reads match bundle
- Central ingest client → Optional central platform: sends enrolled data