fix(multiplayer): fail closed without durable leases

This commit is contained in:
Josh Creek
2026-09-03 21:04:07 +01:00
parent 947fefc95c
commit a4de140424
3 changed files with 10 additions and 2 deletions
+7 -1
View File
@@ -116,7 +116,13 @@ func _ready() -> void:
else:
_connection_leases.queue_free()
_connection_leases = null
ServerLog.warn("connection_lease_backend_unavailable", {"reason": "invalid_or_missing_configuration"})
# Allocated matches must never fall back to an in-memory connection
# generation. Doing so would admit a player without the durable fence
# that prevents a second process (or a stale peer) from owning the same
# ranked slot. Direct/community servers do not enter this branch.
printerr("cosmic-clash-server: refusing allocated startup without connection-lease configuration")
get_tree().quit(1)
return
NetworkManager.client_connected.connect(_on_client_connected)
NetworkManager.client_disconnected.connect(_on_client_disconnected)