Fix: abandon stale Initializing sessions on Game startup

When SOR.Game is redeployed, sessions in Initializing status are
unreachable — clients already sent game.ready to the old process and
won't retry. GameStartupCleanupService runs once at startup, marks all
Initializing sessions as Abandoned (WinCondition = "server_restart"),
and pushes game.session_abandoned to both players so clients can return
to the main menu instead of hanging on the loading screen.

Also fix MatchmakerService to include WinnerOpReward, LoserOpReward,
and RankDiffOpMultiplierPct in the rule snapshot so FinalizeGameAsync
picks up the correct OP rewards from the snapshot.

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-03-09 17:12:54 -04:00
co-authored by Claude Happy
parent 0600326db7
commit 5b8f34e794
4 changed files with 106 additions and 0 deletions
+7
View File
@@ -180,6 +180,13 @@ public sealed record GameOverPush(
int WinnerOpDelta,
int LoserOpDelta);
/// <summary>
/// Pushed to both players when a session that was Initializing is abandoned
/// (e.g., server restart before both players sent game.ready).
/// Clients should return to the main menu and show an appropriate message.
/// </summary>
public sealed record GameSessionAbandonedPush(Guid SessionId, string Reason);
/// <summary>
/// Pushed to both players when a custom lobby is full and a GameSession has been created.
/// Players should navigate to the game screen and send game.ready.