SRCDS Steam group


SRCDS auto launch.
#1
I run a dedicated server for Garry's Mod (works fine) but it occasionally crashes (for whatever reason) and I was wondering if their was some way to get it to relaunch automatically. Such as a batch file.

Any ideas?
Reply
#2
havent tried this myself, but its from another tutorial on another site

Code:
To create a Startup batch file with extra script to restart server if it crashes:
1- Go to your C:\SRCDS directory and create a new text file named L4DServer.bat.
2- Add the following line of code to the batch file:
L4DServer.bat
@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) srcds started.
start /wait l4d\srcds.exe -console -game left4dead +hostip YOUR.WAN.IP.ADDY -ip YOUR.LAN.IP.ADDY +hostport 27016 +clientport 27006 -nohltv +exec server.cfg +map l4d_hospital05_rooftop
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds
Fill in YOUR.WAN.IP.ADDY with your external IP address and YOUR.LAN.IP.ADDY with your internal 'static' IP address if you are behind a router. You could change +map to whichever map you prefer.
Save .bat when finished. Double Click L4DServer.bat to start server with crash protection. :)
Reply
#3
Thank you, I tried to make a script myself but failed miserably.

EDIT:

I simulated a crash and you have to type 'n' and press enter for it to restart. I need to automatically restart!
Reply
#4
PHP Code:
@echo off
cls
echo Protecting srcds from crashes...
echo If 
you want to close srcds and this scriptclose the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) srcds started.
start /wait srcds.exe <SRCDS settings>
echo (%
time%) WARNINGsrcds closed or crashedrestarting.
goto 
srcds 

Paste that into a .bat file in the same dir as your .exe, change <SRCDS settings> to your GMOD launch options, make sure you have it in console too.
Reply
#5
Use this: SRCDS Guardian 3.0
You can download the .bat from there and use that. Plus, it makes naming the window and configuring the server easier then ever.
~ Mooga ...w00t? - SRCDS.com on Twitter
[Image: 76561197965445574.png]
Please do not PM me for server related help
fqdn Wrote:if you've seen the any of the matrix movies, a game server is not all that different. it runs a version of the game that handles the entire world for each client connected. that's the 2 sentence explanation.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)