Fix free game: display names in lobby/game screen + rules fallback

- CustomLobbyGuestJoinedPush: add GuestDisplayName (host now sees guest's real name)
- JoinCustomLobbyResponse: add HostAccountId/Name + GuestAccountId/Name so guest
  lobby room shows correct state instead of "Waiting for guest…"
- CustomLobbyGameStartedPush: add OpponentDisplayName so game screen shows name not GUID
- GameJoinCustomLobbyHandler: use 3-tier rules fallback (lobby override → db custom-default
  → hard-coded default) matching StartGameAsync, fixing inconsistent rule display on join
- GameLobbyReadyHandler: inject SorIdentityDbContext, fetch display names for both
  players before pushing game.custom.started
- CustomLobby.gd: set Game.opponent_name on game.custom.started push; emit display
  names in guest_joined and game_starting signals; patch join response lobby dict
- lobby_room_screen.gd: use display name in _on_guest_joined; update _on_game_starting signature

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-25 12:14:14 -04:00
co-authored by Claude Happy
parent 2a15bd2eb3
commit 0ace4d247b
5 changed files with 114 additions and 59 deletions
+9 -3
View File
@@ -236,7 +236,11 @@ public sealed record JoinCustomLobbyResponse(
Guid LobbyId,
string Status, // "WaitingForReady"
CustomRulesDto ActiveRules,
Guid? GameSessionId); // always null; reserved for future use
Guid? GameSessionId, // always null; reserved for future use
Guid HostAccountId,
string HostDisplayName,
Guid GuestAccountId,
string GuestDisplayName);
public sealed record LeaveCustomLobbyResponse(Guid LobbyId);
@@ -339,13 +343,15 @@ public sealed record GameBothIdlePush(Guid SessionId);
/// Players should navigate to the game screen and send game.ready.
/// </summary>
public sealed record CustomLobbyGameStartedPush(
Guid SessionId,
Guid OpponentAccountId);
Guid SessionId,
Guid OpponentAccountId,
string OpponentDisplayName);
/// <summary>Pushed to the host when a guest joins their open lobby.</summary>
public sealed record CustomLobbyGuestJoinedPush(
Guid LobbyId,
Guid GuestAccountId,
string GuestDisplayName,
string LobbyName);
/// <summary>