mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): project complete queue lifecycle
This commit is contained in:
@@ -161,6 +161,12 @@ static func phase_label(phase: String) -> String:
|
||||
return "Connecting to match"
|
||||
MatchmakingState.LIVE:
|
||||
return "Match in progress"
|
||||
MatchmakingState.RESULT_PENDING:
|
||||
return "Recording match result"
|
||||
MatchmakingState.COMPLETED:
|
||||
return "Match complete"
|
||||
MatchmakingState.ASSIGNED:
|
||||
return "Match assigned"
|
||||
MatchmakingState.CANCELLED:
|
||||
return "Search cancelled"
|
||||
MatchmakingState.EXPIRED:
|
||||
@@ -185,6 +191,10 @@ func _render(snapshot: Dictionary) -> void:
|
||||
detail_label.text = "Review the proposal before the countdown expires"
|
||||
elif phase == MatchmakingState.ACCEPTED:
|
||||
detail_label.text = "All players accepted; preparing the match server"
|
||||
elif phase == MatchmakingState.RESULT_PENDING:
|
||||
detail_label.text = "The server is confirming the final result"
|
||||
elif phase == MatchmakingState.COMPLETED:
|
||||
detail_label.text = "The match result has been recorded"
|
||||
elif phase == MatchmakingState.IDLE:
|
||||
detail_label.text = "Choose a playlist to begin"
|
||||
cancel_button.visible = ControlPlaneClient.state.can_cancel()
|
||||
@@ -197,8 +207,8 @@ func _render(snapshot: Dictionary) -> void:
|
||||
|
||||
|
||||
static func _is_terminal(phase: String) -> bool:
|
||||
return phase in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED, MatchmakingState.LIVE]
|
||||
return phase in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED, MatchmakingState.LIVE, MatchmakingState.COMPLETED]
|
||||
|
||||
|
||||
static func _can_start_new_search(phase: String) -> bool:
|
||||
return phase == MatchmakingState.IDLE or phase in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED]
|
||||
return phase == MatchmakingState.IDLE or phase in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED, MatchmakingState.COMPLETED]
|
||||
|
||||
@@ -17,6 +17,9 @@ const PROCESS_READY := "PROCESS_READY"
|
||||
const ASSIGNMENT_READY := "ASSIGNMENT_READY"
|
||||
const CONNECTING := "CONNECTING"
|
||||
const LIVE := "LIVE"
|
||||
const ASSIGNED := "ASSIGNED"
|
||||
const RESULT_PENDING := "RESULT_PENDING"
|
||||
const COMPLETED := "COMPLETED"
|
||||
const CANCELLED := "CANCELLED"
|
||||
const EXPIRED := "EXPIRED"
|
||||
const FAILED := "FAILED"
|
||||
@@ -185,7 +188,7 @@ func restore_snapshot(saved: Dictionary) -> bool:
|
||||
proposal_revision = maxi(0, int(saved.get("proposal_revision", 0)))
|
||||
proposal_state = String(saved.get("proposal_state", ""))
|
||||
message = "Recovering authoritative matchmaking state"
|
||||
needs_resync = phase != CANCELLED and phase != EXPIRED and phase != FAILED
|
||||
needs_resync = phase != CANCELLED and phase != EXPIRED and phase != FAILED and phase != COMPLETED
|
||||
_emit_changed()
|
||||
return true
|
||||
|
||||
@@ -242,7 +245,7 @@ func _reset() -> void:
|
||||
|
||||
|
||||
func _is_ticket_state(value: String) -> bool:
|
||||
return value in [QUEUED, PROPOSED, ACCEPTED, ALLOCATING, PROCESS_READY, ASSIGNMENT_READY, CONNECTING, LIVE, CANCELLED, EXPIRED, FAILED]
|
||||
return value in [QUEUED, PROPOSED, ACCEPTED, ALLOCATING, PROCESS_READY, ASSIGNMENT_READY, ASSIGNED, CONNECTING, LIVE, RESULT_PENDING, COMPLETED, CANCELLED, EXPIRED, FAILED]
|
||||
|
||||
|
||||
func _has_string(value: Dictionary, key: String) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user