mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 00:14:00 +00:00
fix(multiplayer): align resync recovery targets
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user