Fix 3rd-player lobby ready-up and board shape fallback

3rd-player ready-up (two root causes):
- Server: LobbyReadyStatusPush to additional players was deserialized
  without PropertyNameCaseInsensitive, so after the 3rd player readied
  (converting JSON to camelCase) all subsequent pushes went to Guid.Empty
  → 3rd player never received ready/start notifications
- Client: ready_status push handler treated all non-hosts as "guest",
  so i_am_ready was incorrectly set from guestReady for additional players
  → their ready state was clobbered every time host/guest readied
- Server: JoinCustomLobbyResponse now includes IsAdditionalPlayer flag
  so the client can correctly distinguish guest from 3rd+ player

Board shape fallback:
- GameEngine.cs 2-player overload and GameReadyHandler N-player path both
  now treat "Default"/null BoardShape as AutoShape(playerCount) rather than
  hardcoded "Rectangle", fixing old sessions and ranked matches

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-26 16:00:15 -04:00
co-authored by Claude Happy
parent cf473d812c
commit e9097214fb
6 changed files with 57 additions and 40 deletions
@@ -3,6 +3,7 @@ namespace SOR.Game.Handlers;
using System.Text.Json;
using Microsoft.EntityFrameworkCore;
using SOR.Database.Contexts;
using SOR.Game.Grid;
using SOR.Database.Entities.Catalog;
using SOR.Database.Entities.Collection;
using SOR.Database.Enums;
@@ -194,11 +195,14 @@ internal sealed class GameReadyHandler : GameHandlerBase, IMessageHandler
entry.TeamIndex));
}
var boardShape = rules?.BoardShape is null or "" or "Default"
? BoardShapeGenerator.AutoShape(playerList.Count)
: rules.BoardShape;
state = GameEngine.Initialize(
session.Id,
playerList.AsReadOnly(),
session.GameMode,
rules?.BoardShape ?? "Rectangle",
boardShape,
rules);
}