Implement SOR.Ai Phase 1: project scaffold, transport, seeding, lobby handlers, session manager

- New SOR.Ai project with AI account/deck seeding (50 accounts: 10 difficulty × 5 strategy)
- AiNoOpClientConnection + AiClientMessage: AI invokes game handlers in-process
- AiPlayerSessionManager: BackgroundService subscribing to GameStarted/AiTurnStarted/GameEnded
- AiPlayerSession: sends game.ready and executes turns (Phase 1 stub: pass immediately)
- Lobby handlers: game.ai.add, game.ai.remove, game.ai.configure
- IAiAccountRegistry in SOR.Shared to break circular dependency with SOR.Game
- GameEndTurnHandler + GameReadyHandler publish AiTurnStarted event when AI is active player
- Account entity: IsAi, AiDifficulty, AiStrategy columns
- CustomLobby entity: AiSlotsJson column

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>
This commit is contained in:
dingo
2026-04-12 15:13:38 -04:00
co-authored by Claude Happy
parent c3a39fd7a1
commit 139ba5fbf0
28 changed files with 1738 additions and 2 deletions
@@ -50,4 +50,22 @@ public sealed class Account : IdentityUser<Guid>
/// Use for bots, dev accounts, and internal test accounts.
/// </summary>
public bool IsHiddenFromLeaderboard { get; set; }
// ── AI account fields ─────────────────────────────────────────────────────
/// <summary>
/// True for AI-controlled virtual accounts (seeded by SOR.Ai at startup).
/// AI accounts are excluded from ranked matchmaking, leaderboards, and ELO updates.
/// They join custom lobbies as AI seats and submit game actions in-process.
/// </summary>
public bool IsAi { get; set; }
/// <summary>AI difficulty tier (1–10). Null for human accounts.</summary>
public int? AiDifficulty { get; set; }
/// <summary>
/// AI strategy archetype: "Aggressive" | "Control" | "Balanced" | "Ramp" | "Swarm".
/// Null for human accounts.
/// </summary>
public string? AiStrategy { get; set; }
}