Add [RULES] diagnostic logging + remove [DELTA] console noise
- MatchmakerService: log whether ranked ruleset was found and its StartingRandomTilePct after DB query - GameReadyHandler: log RuleSnapshotJson snippet and deserialized StartingRandomTilePct/BoardWidth/BoardHeight when both players ready - GameHandlerBase: remove [DELTA] Console.WriteLines added for delta diffing debug (issue resolved) 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:
@@ -128,28 +128,9 @@ internal abstract class GameHandlerBase
|
||||
{
|
||||
var prevState = GameEngine.Deserialize(prevStateJson);
|
||||
|
||||
// ── DIAGNOSTIC: log prev/next state to identify why deltas are consistently null ──
|
||||
Console.WriteLine(
|
||||
$"[DELTA] prev: phase={prevState.Phase}({(int)prevState.Phase}) turn={prevState.TurnNumber} " +
|
||||
$"active={prevState.ActivePlayerAccountId} seq={prevState.NextActionSequence}");
|
||||
Console.WriteLine(
|
||||
$"[DELTA] next: phase={state.Phase}({(int)state.Phase}) turn={state.TurnNumber} " +
|
||||
$"active={state.ActivePlayerAccountId} seq={state.NextActionSequence}");
|
||||
Console.WriteLine(
|
||||
$"[DELTA] prevStateJson length={prevStateJson.Length} " +
|
||||
$"sameAsCurrentSession={(prevStateJson == session.StateJson)} " +
|
||||
$"referenceEqual={ReferenceEquals(prevStateJson, session.StateJson)}");
|
||||
// ─────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
var d1 = GameStateDiffer.ComputeDelta(prevState, state, p1Id);
|
||||
var d2 = GameStateDiffer.ComputeDelta(prevState, state, p2Id);
|
||||
|
||||
Console.WriteLine(
|
||||
$"[DELTA] d1: meta={d1.MetaDelta != null} tiles={d1.ChangedTiles != null} " +
|
||||
$"units+={d1.AddedUnits != null} units-={d1.RemovedUnitIds != null} " +
|
||||
$"hand+={d1.HandAdded != null} ownStats={d1.OwnStatsDelta != null} " +
|
||||
$"oppStats={d1.OpponentStatsDelta != null} ver={d1.StateVersion}");
|
||||
|
||||
// Safety fallback: if the differ produces an empty delta (all content fields null),
|
||||
// the client would advance its stateVersion but see no visual changes. Fall back to
|
||||
// a full state_update so clients always reflect the correct post-action state.
|
||||
|
||||
Reference in New Issue
Block a user