mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 21:12:03 +00:00
fix(multiplayer): recover stale proposal mutations
This commit is contained in:
@@ -308,6 +308,7 @@ func _on_request_completed(result: HTTPRequest.Result, response_code: int, _head
|
||||
return
|
||||
if response_code < 200 or response_code >= 300:
|
||||
var detail := String(parsed.get("error", "request rejected"))
|
||||
var recover_proposal_after_conflict := response_code == HTTPClient.RESPONSE_CONFLICT and (operation == "proposal_accept" or operation == "proposal_decline") and not state.proposal_id.is_empty()
|
||||
if response_code == HTTPClient.RESPONSE_UNAUTHORIZED:
|
||||
access_token = ""
|
||||
auth_expired = true
|
||||
@@ -328,6 +329,9 @@ func _on_request_completed(result: HTTPRequest.Result, response_code: int, _head
|
||||
else:
|
||||
state.set_notice(detail)
|
||||
request_failed.emit(operation, response_code, detail)
|
||||
if recover_proposal_after_conflict:
|
||||
_pending_resync_resource_id = state.proposal_id
|
||||
call_deferred("_run_pending_resync")
|
||||
return
|
||||
var payload: Dictionary = parsed
|
||||
if operation == "steam_session":
|
||||
|
||||
Reference in New Issue
Block a user