fix(multiplayer): harden reconnect lifecycle fencing

This commit is contained in:
Josh Creek
2026-09-03 13:24:52 +01:00
parent cee0163eac
commit 8c28374eb4
5 changed files with 62 additions and 8 deletions
+2
View File
@@ -131,6 +131,8 @@ func test_allocated_join_authorisation_is_allowlisted_and_bound_to_server() -> v
match_net._remove_player(43)
match_net._join_history[token]["lost_at"] = Time.get_unix_time_from_system() - MatchNet.RECONNECT_GRACE_SECONDS - 1.0
assert_eq(match_net._reserve_join_authorisation(token, 44), -1, "reclaim after the grace window is fenced")
match_net._join_history[token]["lost_at"] = Time.get_unix_time_from_system() + 60.0
assert_eq(match_net._reserve_join_authorisation(token, 44), -1, "clock-reversed reclaim is fenced")
var malformed_context := {"match_id": 123, "server_id": "server-1", "protocol": "1", "protocol_version": 1}
assert_true(not match_net.configure_join_authorisations([token], malformed_context), "numeric context identity is rejected")
malformed_context = {"match_id": "match-1", "server_id": "server-1", "protocol": "1", "protocol_version": 1.5}