mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
fix(multiplayer): validate match admission context
This commit is contained in:
@@ -96,6 +96,10 @@ 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")
|
||||
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}
|
||||
assert_true(not match_net.configure_join_authorisations([token], malformed_context), "fractional context protocol is rejected")
|
||||
|
||||
|
||||
func test_allocated_join_authorisation_rejects_inconsistent_team_and_slot() -> void:
|
||||
|
||||
Reference in New Issue
Block a user