Files
sor/Server
4a1eb9472b fix(ai): replace event-driven turns with per-session polling loop
AiPlayerSession now drives its own execution via RunAsync():
- Sends game.ready, then polls DB state every 1 s
- IsMyTurn(): Placement = AI hasn't placed yet (simultaneous);
  Draw/Main = AI is the active player
- On turn detection: fires ExecuteTurnAsync in background,
  backs off to 10 s re-check (watchdog against silent failures)
- Interlocked guard prevents concurrent turn execution
- Exits cleanly on Completed/Abandoned session or GameOver phase

AiPlayerSessionManager starts RunAsync instead of SendReadyAsync,
and drops the AiTurnStartedEvent consumer entirely — polling is
resilient to missed events and handles placement without needing
GamePlaceArchSpiritHandler to publish a turn trigger.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-13 09:53:00 -04:00
..