Add anonymous gameplay telemetry client
Adds AIApocalypse.Core.Telemetry — opt-in client that batches events
Adds AIApocalypse.Core.Telemetry — opt-in client that batches events and POSTs to https://aiapocgame.com/api/events (Cloudflare Pages Function backed by Workers Analytics Engine).
Design:
- Default OFF. Player toggles opt-in via SettingsMenu Gameplay tab.
- Anonymous: client-generated UUID stored in PlayerPrefs as player_id. No Steam ID, no email, no IP collected by us.
- Batched: queue grows up to 500 events; flush every 30s or on demand, 50/request. Failed sends re-queue. Sync best-effort flush on quit.
- Never blocks gameplay. All public methods void, no exceptions propagate. Network failures log and drop.
- Card-play sampled 1-in-20 to keep per-run volume bounded.
Wired call sites:
- GameFlowManager.StartNewGame -> RunStarted
- CombatManager.PlayCard -> CardPlayed (sampled)
- PostCombatHandler.HandleVictory -> CombatEnded(win)
- PostCombatHandler.HandleDefeat -> CombatEnded(death) + RunEnded(death)
- PostCombatHandler full-run boss -> RunEnded(win) on Act 3 clear
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Commit 11e17fe by astafford8488.