added server utility files from dasischbims

This commit is contained in:
caesarakalaeii 2023-08-14 00:13:41 +02:00
parent d6ff595532
commit ea0f43629c
6 changed files with 96 additions and 0 deletions

4
server_utilities/env.txt Normal file
View File

@ -0,0 +1,4 @@
STEAM_USERNAME=caesarlp
STEAM_PASSWORD=xxx
ENABLE_BETA=true
BETA_NAME=community-testing

View File

@ -0,0 +1,10 @@
@echo off
setlocal
rem Stop the server
call "stop.bat"
rem Start the server
call "start.bat"
endlocal

View File

@ -0,0 +1,34 @@
@echo off
setlocal
rem Read settings from config.txt
for /f "delims=" %%a in (config.txt) do (
set "%%a"
)
set "battlebit_args=-batchmode -nographics -startserver -Name=%Name% -Password=%Password% -AntiCheat=%AntiCheat% -Hz=%Hz% -Port=%Port% -MaxPing=%MaxPing% -LocalIP=%LocalIP% -VoxelMode=%VoxelMode% -ConfigPath=%ConfigPath% -ApiEndpoint=%ApiEndpoint% -FixedSize=%FixedSize% -FirstSize=%FirstSize% -MaxSize=%MaxSize% -FirstGamemode=%FirstGamemode% -FirstMap=%FirstMap%"
echo /-----------------------------/
echo Server Settings:
echo Name: %Name%
echo Password: %Password%
echo AntiCheat: %AntiCheat%
echo Hz: %Hz%
echo Port: %Port%
echo MaxPing: %MaxPing%
echo LocalIP: %LocalIP%
echo VoxelMode: %VoxelMode%
echo ConfigPath: %ConfigPath%
echo ApiEndpoint: %ApiEndpoint%
echo FixedSize: %FixedSize%
echo FirstSize: %FirstSize%
echo MaxSize: %MaxSize%
echo FirstGamemode: %FirstGamemode%
echo FirstMap: %FirstMap%
echo /-----------------------------/
echo Launching the BattleBit game server...
rem Start the BattleBit game server
Start "" "C:\Users\Administrator\Documents\battlebit\BattleBit.exe" %battlebit_args%
endlocal

11
server_utilities/stop.bat Normal file
View File

@ -0,0 +1,11 @@
@echo off
setlocal
rem Find and terminate the BattleBit game server process
for /f "tokens=2 delims=," %%a in ('tasklist /nh /fi "imagename eq BattleBit.exe" /fo csv') do (
taskkill /pid %%a /f
)
echo BattleBit game server has been stopped.
endlocal

View File

@ -0,0 +1,13 @@
@echo off
setlocal
rem Stop Server
call "stop.bat"
rem Update Server
call "updateorinstall.bat"
rem Start Server
call "start.bat"
endlocal

View File

@ -0,0 +1,24 @@
@echo off
setlocal
rem Read environment variables from the "env" file
for /f "usebackq tokens=1* delims==" %%a in ("env.txt") do (
if "%%a"=="STEAM_USERNAME" set "steamusername=%%b"
if "%%a"=="STEAM_PASSWORD" set "steampassword=%%b"
if "%%a"=="BETA_NAME" set "betaname=%%b"
if "%%a"=="ENABLE_BETA" set "enablebeta=%%b"
)
set "steamusername=%steamusername:\r=%"
set "steampassword=%steampassword:\r=%"
set "betaname=%betaname:\r=%"
set "enablebeta=%enablebeta:\r=%"
rem Log in to SteamCMD using the provided credentials
if "%enablebeta%"=="true" (
"steamcmd.exe" +force_install_dir "C:\Users\Administrator\Documents\battlebit" +login %steamusername% +app_update 671860 -beta %betaname% validate +quit
) else (
"steamcmd.exe" +force_install_dir "C:\Users\Administrator\Desktop\BattleBit\BattleBit" +login %steamusername% +app_update 671860 validate +quit
)
endlocal