fix(multiplayer): align resync recovery targets

This commit is contained in:
Josh Creek
2026-09-01 22:16:50 +01:00
parent cfc82bcea5
commit 1f05f6d524
3 changed files with 18 additions and 2 deletions
+11 -2
View File
@@ -186,6 +186,14 @@ func recover_proposal(proposal_id: String) -> Error:
return _start_request("proposal_recover", HTTPClient.METHOD_GET, "/v1/proposals/" + proposal_id, {}, "")
static func resync_target(resource_id: String, ticket_id: String, proposal_id: String, proposal_open: bool) -> String:
if resource_id == ticket_id and not ticket_id.is_empty():
return ticket_id
if resource_id == proposal_id and not proposal_id.is_empty():
return proposal_id if proposal_open else ticket_id
return ""
func fetch_ranked_profile() -> Error:
return _start_request("ranked_profile", HTTPClient.METHOD_GET, "/v1/profile/ranked", {}, "")
@@ -492,9 +500,10 @@ func _run_pending_resync() -> void:
func _run_resync(resource_id: String) -> void:
if resource_id == state.ticket_id and not state.ticket_id.is_empty():
var target := resync_target(resource_id, state.ticket_id, state.proposal_id, state.has_open_proposal())
if target == state.ticket_id and not state.ticket_id.is_empty():
recover_queue(state.ticket_id)
elif resource_id == state.proposal_id and not state.proposal_id.is_empty():
elif target == state.proposal_id and not state.proposal_id.is_empty():
recover_proposal(state.proposal_id)