mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-14 21:02:03 +00:00
feat: add allocated server compatibility config
This commit is contained in:
@@ -126,3 +126,26 @@ func test_help_is_requested_without_needing_a_valid_command_line() -> void:
|
||||
assert_true(config.help_requested, "--help is recognised")
|
||||
var short = _parse(["-h"])
|
||||
assert_true(short.help_requested, "-h too")
|
||||
|
||||
|
||||
func test_allocated_mode_is_opt_in_and_requires_compatibility_manifest() -> void:
|
||||
var community = _parse([])
|
||||
assert_true(community.is_valid(), "community defaults remain valid")
|
||||
assert_eq(community.get_value("allocated-mode"), false, "allocation is opt-in")
|
||||
var incomplete = _parse(["--allocated-mode", "--transport=enet"])
|
||||
assert_true(not incomplete.is_valid(), "allocated mode cannot start without its manifest")
|
||||
var valid = _parse([
|
||||
"--allocated-mode", "--match-id=match_1234567890123456", "--server-id=server_1234567890123456",
|
||||
"--playlist-version=2026-08-31", "--server-image-digest=sha256:" + "a".repeat(64),
|
||||
"--transport=enet", "--region=EU"
|
||||
])
|
||||
assert_true(valid.is_valid(), "a complete allocated compatibility manifest is accepted: %s" % str(valid.errors))
|
||||
|
||||
|
||||
func test_allocated_mode_rejects_invalid_transport_region_or_digest() -> void:
|
||||
var args := [
|
||||
"--allocated-mode", "--match-id=m", "--server-id=s", "--playlist-version=v",
|
||||
"--server-image-digest=sha256:" + "g".repeat(64), "--transport=udp", "--region=AP"
|
||||
]
|
||||
var config = _parse(args)
|
||||
assert_true(not config.is_valid(), "invalid compatibility values are rejected")
|
||||
|
||||
Reference in New Issue
Block a user