From 86167a3a1b591a6b0ecd801ccc84b74974c77223 Mon Sep 17 00:00:00 2001 From: npc0-hue Date: Mon, 7 Sep 2026 14:56:12 +0800 Subject: [PATCH] Fix SCUM query port startup input --- platform/service/scum_deployment_test.go | 2 +- plugins/examples/scum-server-plugin/actions/start.json | 2 -- plugins/examples/scum-server-plugin/bin/scum-start.cmd | 5 +++-- plugins/tests/manifest-validation.test.ts | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/service/scum_deployment_test.go b/platform/service/scum_deployment_test.go index ef1ebc4..889478c 100644 --- a/platform/service/scum_deployment_test.go +++ b/platform/service/scum_deployment_test.go @@ -40,7 +40,7 @@ func TestApplyPluginCreateDefaultsUsesPluginFields(t *testing.T) { plugin := scumDeploymentTestPlugin() definition := applyPluginCreateDefaults(plugin, domain.ServerDeploymentDefinition{Mode: domain.ServerDeploymentModeGuided, CreateInputs: map[string]string{"serverName": "Moon"}}) - if definition.CreateInputs["serverName"] != "Moon" || definition.CreateInputs["gamePort"] != "7779" || definition.CreateInputs["maxPlayers"] != "128" { + if definition.CreateInputs["serverName"] != "Moon" || definition.CreateInputs["gamePort"] != "7779" || definition.CreateInputs["queryPort"] != "27015" || definition.CreateInputs["maxPlayers"] != "128" { t.Fatalf("expected plugin defaults to fill missing guided inputs: %+v", definition.CreateInputs) } } diff --git a/plugins/examples/scum-server-plugin/actions/start.json b/plugins/examples/scum-server-plugin/actions/start.json index 4aee5c1..6f365ca 100644 --- a/plugins/examples/scum-server-plugin/actions/start.json +++ b/plugins/examples/scum-server-plugin/actions/start.json @@ -10,8 +10,6 @@ "GAME_ID": "scum", "SERVER_ACTION": "start", "SERVER_EXECUTABLE_REF": "SCUM/Binaries/Win64/SCUMServer.exe", - "SERVER_PORT_FIELD": "gamePort", - "SERVER_MAX_PLAYERS_FIELD": "maxPlayers", "SERVER_LOG_FLAG": "-log -stdout -FullStdOutLogOutput" }, "timeoutMs": 30000 diff --git a/plugins/examples/scum-server-plugin/bin/scum-start.cmd b/plugins/examples/scum-server-plugin/bin/scum-start.cmd index 395e446..7f85c57 100755 --- a/plugins/examples/scum-server-plugin/bin/scum-start.cmd +++ b/plugins/examples/scum-server-plugin/bin/scum-start.cmd @@ -7,6 +7,7 @@ if "%SERVER_EXECUTABLE_REF%"=="" set "SERVER_EXECUTABLE_REF=SCUM\Binaries\Win64\ if "%SERVER_INSTALL_DIR%"=="" set "SERVER_INSTALL_DIR=%SERVER_ROOT_WINDOWS%" set "SERVER_INSTALL_DIR_WINDOWS=%SERVER_INSTALL_DIR:/=\%" if "%SERVER_CREATE_GAMEPORT%"=="" set "SERVER_CREATE_GAMEPORT=7779" +if "%SERVER_CREATE_QUERYPORT%"=="" set "SERVER_CREATE_QUERYPORT=27015" if "%SERVER_CREATE_MAXPLAYERS%"=="" set "SERVER_CREATE_MAXPLAYERS=128" if "%SERVER_LOG_FLAG%"=="" set "SERVER_LOG_FLAG=-log -stdout -FullStdOutLogOutput" @@ -34,8 +35,8 @@ for %%I in ("%SCUM_EXE_DIR%..\..\..") do set "SCUM_WORKDIR=%%~fI" if not exist "%SCUM_WORKDIR%" set "SCUM_WORKDIR=%SERVER_ROOT_WINDOWS%" pushd "%SCUM_WORKDIR%" -echo [scum-start] Starting "%SCUM_EXE%" -port=%SERVER_CREATE_GAMEPORT% -MaxPlayers=%SERVER_CREATE_MAXPLAYERS% %SERVER_LOG_FLAG% -"%SCUM_EXE%" -port=%SERVER_CREATE_GAMEPORT% -MaxPlayers=%SERVER_CREATE_MAXPLAYERS% %SERVER_LOG_FLAG% +echo [scum-start] Starting "%SCUM_EXE%" -port=%SERVER_CREATE_GAMEPORT% -QueryPort=%SERVER_CREATE_QUERYPORT% -MaxPlayers=%SERVER_CREATE_MAXPLAYERS% %SERVER_LOG_FLAG% +"%SCUM_EXE%" -port=%SERVER_CREATE_GAMEPORT% -QueryPort=%SERVER_CREATE_QUERYPORT% -MaxPlayers=%SERVER_CREATE_MAXPLAYERS% %SERVER_LOG_FLAG% set "SCUM_START_RESULT=%ERRORLEVEL%" popd exit /b %SCUM_START_RESULT% diff --git a/plugins/tests/manifest-validation.test.ts b/plugins/tests/manifest-validation.test.ts index 61634a0..30a2c19 100644 --- a/plugins/tests/manifest-validation.test.ts +++ b/plugins/tests/manifest-validation.test.ts @@ -192,7 +192,8 @@ describe("plugin manifest validation", () => { expect(startScript).toContain("%SERVER_INSTALL_DIR_WINDOWS%\\%SERVER_EXECUTABLE_REF:/=\\%"); expect(startScript).toContain("steamcmd\\steamapps\\common\\SCUM Server"); expect(startScript).toContain("SCUM_WORKDIR"); - expect(startScript).toContain("-port=%SERVER_CREATE_GAMEPORT% -MaxPlayers=%SERVER_CREATE_MAXPLAYERS% %SERVER_LOG_FLAG%"); + expect(startScript).toContain('if "%SERVER_CREATE_QUERYPORT%"=="" set "SERVER_CREATE_QUERYPORT=27015"'); + expect(startScript).toContain("-port=%SERVER_CREATE_GAMEPORT% -QueryPort=%SERVER_CREATE_QUERYPORT% -MaxPlayers=%SERVER_CREATE_MAXPLAYERS% %SERVER_LOG_FLAG%"); }); it("rejects lifecycle executable assets missing from the manifest seed declaration", () => {