mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 20:33:44 +00:00
feat(multiplayer): persist ranked arena allocations
This commit is contained in:
@@ -343,11 +343,12 @@ func withAllocatedCompatibility(command []string, gameServer GameServer) ([]stri
|
||||
return command, nil
|
||||
}
|
||||
for annotation, flag := range map[string]string{
|
||||
"cosmic-clash.io/playlist": "playlist",
|
||||
"cosmic-clash.io/region": "region",
|
||||
"cosmic-clash.io/build": "client-build",
|
||||
"cosmic-clash.io/protocol": "protocol-version",
|
||||
"cosmic-clash.io/transport": "transport",
|
||||
"cosmic-clash.io/arena-path": "arena-path",
|
||||
"cosmic-clash.io/playlist": "playlist",
|
||||
"cosmic-clash.io/region": "region",
|
||||
"cosmic-clash.io/build": "client-build",
|
||||
"cosmic-clash.io/protocol": "protocol-version",
|
||||
"cosmic-clash.io/transport": "transport",
|
||||
} {
|
||||
value := annotations[annotation]
|
||||
if value == "" {
|
||||
|
||||
@@ -35,17 +35,18 @@ func TestWithAllocatedConfigOverridesAuthoritativeChildFlags(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWithAllocatedCompatibilityOverridesStaleFlagsAndRejectsUnsafeValues(t *testing.T) {
|
||||
command := []string{"game-server", "--region=EU", "--client-build=stale", "--protocol-version=1", "--transport=enet", "--custom=keep"}
|
||||
command := []string{"game-server", "--region=EU", "--client-build=stale", "--protocol-version=1", "--transport=enet", "--arena-path=res://stale.tscn", "--custom=keep"}
|
||||
gameServer := GameServer{}
|
||||
gameServer.ObjectMeta.Annotations = map[string]string{
|
||||
"cosmic-clash.io/region": "NA", "cosmic-clash.io/build": "build-live",
|
||||
"cosmic-clash.io/protocol": "12", "cosmic-clash.io/transport": "steam_sdr",
|
||||
"cosmic-clash.io/arena-path": "res://scenes/arena_01.tscn",
|
||||
}
|
||||
got, err := withAllocatedCompatibility(command, gameServer)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, want := range []string{"--region=NA", "--client-build=build-live", "--protocol-version=12", "--transport=steam_sdr", "--custom=keep"} {
|
||||
for _, want := range []string{"--region=NA", "--client-build=build-live", "--protocol-version=12", "--transport=steam_sdr", "--arena-path=res://scenes/arena_01.tscn", "--custom=keep"} {
|
||||
found := false
|
||||
for _, arg := range got {
|
||||
if arg == want {
|
||||
|
||||
Reference in New Issue
Block a user