From dc7267744b9787fba8aef93689e1999164606d49 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 12 Sep 2024 22:13:09 +0200 Subject: [PATCH] Add/edit tool script templates for later install while building --- tools/brokkserv.bat | 2 ++ tools/runserver.bat | 45 ++++++++++++++++++++++++++++++++++++++++++++ tools/sindriserv.bat | 2 ++ 3 files changed, 49 insertions(+) create mode 100644 tools/brokkserv.bat create mode 100644 tools/sindriserv.bat diff --git a/tools/brokkserv.bat b/tools/brokkserv.bat new file mode 100644 index 0000000..70bf2fa --- /dev/null +++ b/tools/brokkserv.bat @@ -0,0 +1,2 @@ +@ECHO OFF +CALL serv.bat brokk-server.exe Brokk-Server %* diff --git a/tools/runserver.bat b/tools/runserver.bat index bd44c47..837755d 100644 --- a/tools/runserver.bat +++ b/tools/runserver.bat @@ -19,6 +19,8 @@ set "login_running=false" set "char_running=false" set "web_running=false" set "map_running=false" +set "brokk_running=false" +set "sindri_running=false" if "%target%" == "status" ( @@ -39,6 +41,8 @@ call :stopLogin call :stopChar call :stopWeb call :stopMap +call :stopBrokk +call :stopSindri goto :EOF :Watch @@ -49,6 +53,8 @@ call :startLogin call :startChar call :startWeb call :startMap +call :startBrokk +call :startSindri goto :EOF :Start @@ -58,6 +64,8 @@ call :startLogin call :startChar call :startWeb call :startMap +call :startBrokk +call :startSindri goto :EOF :getStatus @@ -66,6 +74,8 @@ call :getLoginStatus call :getCharStatus call :getWebStatus call :getMapStatus +call :getBrokkStatus +call :getSindriStatus if "%login_running%" == "false" ( echo "login_serv is not running" ) else echo "login_serv is running pid=%LoginServPID%" @@ -75,6 +85,11 @@ if "%web_running%" == "false" ( echo "web_serv is not running" ) else echo "web_serv is running pid=%WebServPID%" if "%map_running%" == "false" ( echo "map_serv is not running" ) else echo "map_serv is running pid=%MapServPID%" +if "%brokk_running%" == "false" ( echo "brokk_serv is not running" +) else echo "brokk_serv is running pid=%BrokkServPID%" +if "%sindri_running%" == "false" ( echo "sindri_serv is not running" +) else echo "sindri_serv is running pid=%SindriServPID%" + goto :EOF @@ -104,6 +119,15 @@ goto :EOF call :getMapStatus if "%map_running%" == "true" Taskkill /PID %MapServPID% /F goto :EOF +:stopBrokk +call :getBrokkStatus +if "%brokk_running%" == "true" Taskkill /PID %BrokkServPID% /F +goto :EOF +:stopSindri +call :getSindriStatus +if "%sindri_running%" == "true" Taskkill /PID %SindriServPID% /F +goto :EOF + REM start sub targets :startLogin @@ -129,6 +153,17 @@ call :getMapStatus if "%map_running%" == "false" ( start cmd /k mapserv.bat %restart_mode% ) else echo "Map serv is already running, pid=%MapServPID%" goto :EOF +:startBrokk +call :getBrokkStatus +if "%brokk_running%" == "false" ( start cmd /k brokkserv.bat %restart_mode% +) else echo "Brokk serv is already running, pid=%BrokkServPID%" +goto :EOF +:startSindri +call :getMapStatus +if "%sindri_running%" == "false" ( start cmd /k sindriserv.bat %restart_mode% +) else echo "Sindri serv is already running, pid=%SindriServPID%" +goto :EOF + REM status sub targets @@ -151,3 +186,13 @@ goto :EOF for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq map-server.exe"') do set MapServPID=%%b echo(%MapServPID%|findstr "^[-][1-9][0-9]*$ ^[1-9][0-9]*$ ^0$">nul&& set "map_running=true" || set "map_running=false" goto :EOF + +:getBrokkStatus +for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq brokk-server.exe"') do set BrokkServPID=%%b +echo(%BrokkServPID%|findstr "^[-][1-9][0-9]*$ ^[1-9][0-9]*$ ^0$">nul&& set "brokk_running=true" || set "brokk_running=false" +goto :EOF + +:getSindriStatus +for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq sindri-server.exe"') do set SindriServPID=%%b +echo(%SindriServPID%|findstr "^[-][1-9][0-9]*$ ^[1-9][0-9]*$ ^0$">nul&& set "sindri_running=true" || set "sindri_running=false" +goto :EOF \ No newline at end of file diff --git a/tools/sindriserv.bat b/tools/sindriserv.bat new file mode 100644 index 0000000..7c7147e --- /dev/null +++ b/tools/sindriserv.bat @@ -0,0 +1,2 @@ +@ECHO OFF +CALL serv.bat sindri-server.exe Sindri-Server %*