mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
feat(multiplayer): persist ranked arena allocations
This commit is contained in:
@@ -60,6 +60,7 @@ static func specs() -> Array[Spec]:
|
||||
out.append(Spec.new("min-players", Kind.INT, 1, "match", "Players required before a match starts"))
|
||||
out.append(Spec.new("start-countdown", Kind.FLOAT, 5.0, "match", "Seconds to wait after min-players is met before starting"))
|
||||
out.append(Spec.new("arena-rotation", Kind.STRING, "sequential", "match", "How the next arena is picked: sequential or random"))
|
||||
out.append(Spec.new("arena-path", Kind.STRING, "", "match", "Allocated arena scene path; empty uses rotation"))
|
||||
out.append(Spec.new("smoke-force-goal-after", Kind.FLOAT, -1.0, "match", "LOCAL TEST ONLY: force one server-authoritative goal this many seconds after play starts; -1 disables"))
|
||||
out.append(Spec.new("fill-bots", Kind.BOOL, false, "match", "Give a disconnected player's ship to a bot instead of leaving it inert"))
|
||||
out.append(Spec.new("slot-reservation-seconds", Kind.FLOAT, 30.0, "match", "How long a departed player's slot is held for their return"))
|
||||
@@ -268,6 +269,9 @@ func _validate() -> void:
|
||||
var rotation := String(values["arena-rotation"])
|
||||
if not rotation in ["sequential", "random"]:
|
||||
errors.append("--arena-rotation must be sequential or random, got '%s'" % rotation)
|
||||
var arena_path := String(values["arena-path"])
|
||||
if not arena_path.is_empty() and not arena_path in ArenaRegistry.rotation_paths():
|
||||
errors.append("--arena-path must be a ranked-eligible ArenaRegistry path, got '%s'" % arena_path)
|
||||
if bool(values["allocated-mode"]):
|
||||
for key in ["match-id", "server-id", "playlist-version", "playlist", "client-build", "assignment-expiry-unix", "server-image-digest", "transport", "region"]:
|
||||
if str(values[key]).is_empty():
|
||||
@@ -290,6 +294,8 @@ func _validate() -> void:
|
||||
var playlist := String(values["playlist"])
|
||||
if not playlist in ["casual", "ranked"]:
|
||||
errors.append("--playlist must be casual or ranked, got '%s'" % playlist)
|
||||
if playlist == "ranked" and arena_path.is_empty():
|
||||
errors.append("--allocated-mode ranked matches require --arena-path")
|
||||
|
||||
|
||||
static func _is_sha256_digest(value: String) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user