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
@@ -215,8 +215,9 @@ func _update_rules_label() -> void:
# ── Signal handlers ───────────────────────────────────────────────────────────
func _on_guest_joined(guest_account_id: String) -> void:
guest_name_label.text = "Guest: %s" % guest_account_id.substr(0, 8)
func _on_guest_joined(guest_account_id: String, guest_display_name: String) -> void:
var name := guest_display_name if not guest_display_name.is_empty() else guest_account_id.substr(0, 8)
guest_name_label.text = "Guest: %s" % name
guest_deck_label.text = "Deck: (selected)"
@@ -234,7 +235,7 @@ func _on_deck_changed(_account_id: String, _deck_id: String) -> void:
guest_deck_label.text = "Deck: (updated)"
func _on_game_starting(session_id: String, _opponent_account_id: String) -> void:
func _on_game_starting(session_id: String, _opponent_account_id: String, _opponent_display_name: String) -> void:
ready_btn.disabled = true
ready_btn.text = "Starting…"
await get_tree().create_timer(0.8).timeout