fix: handle matchmaking session expiry

This commit is contained in:
Josh Creek
2026-08-31 22:47:31 +01:00
parent 3e94960f0a
commit e1807d2492
3 changed files with 15 additions and 2 deletions
+8 -1
View File
@@ -29,6 +29,7 @@ func _ready() -> void:
ControlPlaneClient.state.changed.connect(_on_state_changed)
ControlPlaneClient.request_failed.connect(_on_request_failed)
ControlPlaneClient.request_succeeded.connect(_on_request_succeeded)
ControlPlaneClient.session_expired.connect(_on_session_expired)
_refresh_ranked_profile()
_render(ControlPlaneClient.state.snapshot())
@@ -125,6 +126,12 @@ func _on_request_failed(_operation: String, _http_code: int, detail: String) ->
_render(ControlPlaneClient.state.snapshot())
func _on_session_expired() -> void:
status_label.text = "Session expired"
detail_label.text = "Sign in again before searching for a match"
queue_button.disabled = true
func _on_local_error(detail: String) -> void:
detail_label.text = detail
@@ -171,7 +178,7 @@ func _render(snapshot: Dictionary) -> void:
cancel_button.visible = ControlPlaneClient.state.can_cancel()
accept_button.visible = phase == MatchmakingState.PROPOSED
decline_button.visible = phase == MatchmakingState.PROPOSED
queue_button.disabled = not (_can_start_new_search(phase) or ControlPlaneClient.can_retry_queue_create())
queue_button.disabled = ControlPlaneClient.auth_expired or not (_can_start_new_search(phase) or ControlPlaneClient.can_retry_queue_create())
queue_button.text = "Retry Search" if ControlPlaneClient.can_retry_queue_create() else "Search"