feat(dragonwilds): MATCH_PUBLIC so the join code works behind a relay #29
No files matched your search
@@ -153,6 +153,13 @@ func bootTestPayload(gamesDir, id string, fillBlank bool) (map[string]any, error
|
||||
}
|
||||
}
|
||||
|
||||
// The panel fills {PUBLIC_IP}, {PUBLIC_HOST} and {PUBLIC_PORT_n} in the startup command too
|
||||
startup := g["defaultStartupCommand"]
|
||||
if cmd, ok := startup.(string); ok {
|
||||
cmd = strings.NewReplacer("{PUBLIC_IP}", "127.0.0.1", "{PUBLIC_HOST}", "127.0.0.1").Replace(cmd)
|
||||
startup = publicPort.ReplaceAllString(cmd, "$1")
|
||||
}
|
||||
|
||||
return map[string]any{
|
||||
"command": "DEPLOY_SERVER",
|
||||
"serverId": "boottest-" + id,
|
||||
@@ -166,7 +173,7 @@ func bootTestPayload(gamesDir, id string, fillBlank bool) (map[string]any, error
|
||||
"configFilePath": g["configFilePath"],
|
||||
"configFileFormat": g["configFileFormat"],
|
||||
"configFormatOptions": g["configFormatOptions"],
|
||||
"startupCommand": g["defaultStartupCommand"],
|
||||
"startupCommand": startup,
|
||||
"memoryLimitMb": g["requiredMemoryMb"],
|
||||
"containerUser": g["containerUser"],
|
||||
"dockerNetwork": bootTestNetwork,
|
||||
|
||||
@@ -132,3 +132,18 @@ func TestSteamCacheStampAge(t *testing.T) {
|
||||
t.Error("old, missing or garbled stamps are not fresh")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBootTestPayloadFillsPublicPlaceholdersInStartupCommand(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
game := filepath.Join(dir, "example")
|
||||
os.MkdirAll(game, 0o755)
|
||||
os.WriteFile(filepath.Join(game, "game.yaml"), []byte("id: example\nname: Example\ndefaultDockerImage: x\n"+
|
||||
"defaultStartupCommand: ./server -Port={PUBLIC_PORT_7777} -ip={PUBLIC_IP}\ndefaultPorts:\n - 7777/udp\n"), 0o644)
|
||||
p, err := bootTestPayload(dir, "example", false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if p["startupCommand"] != "./server -Port=7777 -ip=127.0.0.1" {
|
||||
t.Errorf("startupCommand %v", p["startupCommand"])
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ var gameFields = []string{
|
||||
"defaultConfig", "configSchema", "configFilePath", "configFileFormat", "configFormatOptions",
|
||||
"agnosticCommandConfig", "clusterConfig",
|
||||
"logFilePath", "readyPattern", "failPatterns", "backupPaths", "maxBackupSizeMb",
|
||||
"publicIpConfigKey", "maxPlayersConfigKey", "mapConfigKey",
|
||||
"publicIpConfigKey", "portMode", "maxPlayersConfigKey", "mapConfigKey",
|
||||
"aiCoverPrompt",
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
id: runescape-dragonwilds-native-linux
|
||||
name: 'RuneScape: Dragonwilds (Native Linux Server)'
|
||||
defaultDockerImage: cm2network/steamcmd:root
|
||||
defaultStartupCommand: ./RSDragonwildsServer.sh -log -Port=7777
|
||||
defaultStartupCommand: ./RSDragonwildsServer.sh -log -Port={PUBLIC_PORT_7777} -BeaconPort={PUBLIC_PORT_8888}
|
||||
requiredMemoryMb: 10240
|
||||
requiredDiskMb: 20480
|
||||
defaultPorts:
|
||||
@@ -113,5 +113,6 @@ backupPaths:
|
||||
- RSDragonwilds/Saved
|
||||
maxBackupSizeMb: 5000
|
||||
publicIpConfigKey: MULTIHOME
|
||||
portMode: MATCH_PUBLIC
|
||||
maxPlayersConfigKey: MaxPlayers
|
||||
aiCoverPrompt: 'A cinematic wide shot of Ashenfall in the fantasy world of Gielinor from RuneScape: Dragonwilds. Ancient stone spires and forgotten fortresses rise amidst untamed wilderness. Colossal ancient dragons circle through stormy twilight skies illuminated by magical embers, while adventurers gather around a runic encampment wielding enchanted sorcery and survival gear.'
|
||||
@@ -69,6 +69,10 @@
|
||||
"maxBackupSizeMb": { "type": ["integer", "null"], "minimum": 1 },
|
||||
|
||||
"publicIpConfigKey": { "description": "Config key that receives the server's public address.", "type": ["string", "null"] },
|
||||
"portMode": {
|
||||
"description": "MATCH_PUBLIC: for games that advertise the address their own traffic comes from. The container binds the port players use (the relay port behind Public Bypass) and, behind a relay, all its outgoing traffic leaves through the relay. Tell the game its port with {PUBLIC_PORT_<defaultPort>} in defaultStartupCommand.",
|
||||
"enum": ["DEFAULT", "MATCH_PUBLIC", null]
|
||||
},
|
||||
"maxPlayersConfigKey": { "description": "Config key locked to the pricing tier's player count.", "type": ["string", "null"] },
|
||||
"mapConfigKey": { "type": ["string", "null"] },
|
||||
|
||||
|
||||
Reference in new issue
Block a user