Make custom lobby leave idempotent for stale lobby IDs

This commit is contained in:
Shard
2026-03-27 03:07:44 +00:00
parent c2e19a38fe
commit 775b30d8a4
2 changed files with 13 additions and 3 deletions
@@ -168,7 +168,12 @@ func leave(on_done: Callable = Callable()) -> void:
lobby_left.emit()
if on_done.is_valid(): on_done.call(),
func(code: String, msg: String) -> void:
print("[CustomLobby] ERR leave ", code, " ", msg))
print("[CustomLobby] ERR leave ", code, " ", msg)
if code == "LOBBY_NOT_FOUND":
# Treat as stale local lobby state and recover UX.
clear_state()
lobby_left.emit()
if on_done.is_valid(): on_done.call())
## Mark the caller as ready with their final deck and first-turn preference.