SRCDS Steam group


[resolved] Universal Autorestart Batch
#1
I'm quite aware that a tutorial somewhere on this forum exists for this exact purpose. I figured I would share my version of it regardless in case someone could benefit from my work. I basically combined all the tutorials I fell upon to make a nice looking auto-restart batch file that uses variables. I've also added the "/high" command to set the processing priority to high for srcds.exe.

(note that I'm also aware that there exists programs such as firedaemon that could manage server crashing much better)

Server OS: Windows 7 Ultimate x64
Processor: AMD Athlon x2 6000+ 3.11 Ghz
Ram: 8Gb
Game(s): All SRCDS
Start Up Command: n/a
Admin Mods: n/a

I currently use this for my TF2, my CSS and my l4d2 servers.
Below is the batch using l4d2 as an example:

Code:
@echo off
REM Painphul's SRCDS Auto-Restart Batch

set gameName=Left 4 Dead 2
set codeName=left4dead2
set updatePath=D:\Dedicated-Servers\HL2
set launchLine=D:\Dedicated-Servers\HL2\left4dead2\srcds.exe -console -port 27020 -game left4dead2 -maxplayers 8 +map c1m1_hotel +max_fps 700

echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo (%time%) %gameName% Server Batch Script Executed
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
echo ----------------------------------------------------------------------
echo (%time%) %gameName% Server Update Started
start /wait %updatePath%\hldsupdatetool.exe -command update -game %codeName% -dir %updatePath%
echo (%time%) %gameName% Server Update Ended
echo ----------------------------------------------------------------------
echo.

:srcds
echo (%time%) %gameName% Server Launched
start /high /wait %launchLine%
echo.
echo /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
echo (%time%) WARNING: %gameName% srcds closed or crashed, restarting.
echo /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
echo.
goto srcds
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)