fix: retry queue creation idempotently

This commit is contained in:
Josh Creek
2026-08-31 22:46:45 +01:00
parent 222bbb5b84
commit 3e94960f0a
3 changed files with 29 additions and 3 deletions
+7 -1
View File
@@ -52,6 +52,11 @@ func _process(delta: float) -> void:
func _on_queue_pressed() -> void:
if ControlPlaneClient.can_retry_queue_create():
var retry_err := ControlPlaneClient.retry_queue_create()
if retry_err != OK:
_on_local_error("Could not retry matchmaking: %s" % error_string(retry_err))
return
if not _can_start_new_search(ControlPlaneClient.state.phase):
return
_elapsed_seconds = 0.0
@@ -166,7 +171,8 @@ 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)
queue_button.disabled = 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"
static func _is_terminal(phase: String) -> bool: