mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 19:33:44 +00:00
fix(multiplayer): defer reconnect recovery during mutations
This commit is contained in:
@@ -466,10 +466,14 @@ func _set_websocket_status(status: String) -> void:
|
||||
websocket_status_changed.emit(status)
|
||||
if status == "CONNECTED":
|
||||
if not state.ticket_id.is_empty() and state.phase not in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED, MatchmakingState.LIVE]:
|
||||
if not state.proposal_id.is_empty():
|
||||
recover_proposal(state.proposal_id)
|
||||
var resource_id := state.proposal_id if not state.proposal_id.is_empty() else state.ticket_id
|
||||
if _operation.is_empty():
|
||||
_run_resync(resource_id)
|
||||
else:
|
||||
recover_queue(state.ticket_id)
|
||||
# A reconnect must not lose its authoritative recovery merely because
|
||||
# the previous mutation has not acknowledged yet. The deferred path
|
||||
# runs after that request completes and avoids an ERR_BUSY drop.
|
||||
_pending_resync_resource_id = resource_id
|
||||
|
||||
|
||||
func _idempotency_key(prefix: String) -> String:
|
||||
|
||||
Reference in New Issue
Block a user