Fix null-session prompt, stale ready state, spectator UI, and admin cancel
- init_screen.gd: handle null sessionId from game.get_active_session.ack properly — str(null)="<null>" which passed the is_empty() check causing every player to see "active game in progress (null phase)" on login - CustomLobby.gd: call clear_state() at the start of create() and join() so that i_am_ready/partner_ready are reset between lobbies — fixes players appearing instantly ready when entering a new lobby after a previous game - game_screen.gd: in _setup_spectator_ui(), hide _settings_btn (prevents accessing the Concede button) and add a programmatic "Leave" button that calls Game.stop_spectating() and navigates back to FreePlayScreen - CustomLobbiesPage.razor: add Cancel button (admin) for Open/Full lobbies; directly sets Status=Cancelled and refreshes the list 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:
@@ -127,14 +127,19 @@ func _check_active_session() -> void:
|
||||
|
||||
|
||||
func _on_active_session(payload: Variant) -> void:
|
||||
var p := payload as Dictionary
|
||||
var sid : String = str(p.get("sessionId", ""))
|
||||
# A null or zero UUID means no active session.
|
||||
var p := payload as Dictionary
|
||||
var sid_raw = p.get("sessionId") # may be null when server has no active session
|
||||
# Treat null or zero UUID as "no active session".
|
||||
if sid_raw == null:
|
||||
_go_to_main()
|
||||
return
|
||||
var sid : String = str(sid_raw)
|
||||
if sid.is_empty() or sid == "00000000-0000-0000-0000-000000000000":
|
||||
_go_to_main()
|
||||
return
|
||||
|
||||
var phase : String = str(p.get("phase", "unknown"))
|
||||
var phase_raw = p.get("phase")
|
||||
var phase : String = str(phase_raw) if phase_raw != null else "unknown"
|
||||
var dialog := ConfirmationDialog.new()
|
||||
dialog.title = "Active Game Found"
|
||||
dialog.dialog_text = "You have an active game in progress (%s phase).\nWould you like to rejoin?" % phase
|
||||
|
||||
Reference in New Issue
Block a user