SRCDS Steam group


Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SRCDS Guardian 2.0 - Keep your server running
#1
SRCDS Guardian 3.0 is now available!

For those of you who have not used SRCDS Guardian before, it's a windows batch script made to restart the server if it is shut down. It was first built by Black-Sky & Drocona. I then released an edited version with some basic customizations. However, editing the script with the customizations required searching through and replacing a lot of things.

SRCDS Guardian 2.0 does away with this by setting variables at the start of the script to make everything easier. Below is the script. I've also added it in a zip file. (Since we can't add .bat files)

Enjoy!

SRCDS Guardian 3.0 is now available!

Code:
::=======================::
::  SRCDS Guardian 2.0   ::
::         Mooga         ::
::       srcds.com       ::
::=======================::

::=========================================================::
:: Thanks To Black-Sky & Drocona for making SRCDS Guardian ::
:: This script is open source.  Feel free to edit at will. ::
::                                                         ::
:: This script was writen for the use of the srcds.com     ::
:: online community.  If you are interested in running a   ::
:: Source Dedicated Server or need help, drop by our       ::
:: forums at... http://forums.srcds.com                    ::
::=========================================================::



:: This will keep the window clean and easy to read
@echo off

::=======================::
::  SET YOUR VARIABLES!  ::
::=======================::

::=======================::
::  Window and Log name  ::
::  Replace "My Server"  ::
::=======================::
set servername="My server"

::=======================::
::   Your start command  ::
::=======================::
set runcmd=C:\hl2server\orangebox\srcds.exe -console -game tf -maxplayers 24 +fps_max 200 -port 27015 +map ctf_2fort -tickrate 66

:: Sets the title of the window
title SRCDS Guardian 2.0   %servername%


:: Clears the window incase there is anything there
cls


:: Prints to the window what we are doing
echo SRCDS Guardian 2.0 has been started!
echo.
echo **************************************************************************
echo To close the server, close this windows and type exit in the server window
echo **************************************************************************
echo.
echo.

>> %servername%_Guardian.log echo.
>> %servername%_Guardian.log echo (%date%)(%time%) SRCDS Guardian 2.0 has been started!

echo (%date%)(%time%) %servername% is now starting...
>> %servername%_Guardian.log echo (%date%)(%time%) %servername% is now starting...

:: This is a return point in case the server crashes or is closed
:restart

echo (%date%)(%time%) %servername% is now online
>> %servername%_Guardian.log echo (%date%)(%time%) %servername% is now online

echo Watching %servername% for crashes...
>> %servername%_Guardian.log echo (%date%)(%time%) Watching %servername% for crashes...

::Start the actual server
start /wait %runcmd%

echo (%date%)(%time%) Crash or Close detected!
>> %servername%_Guardian.log echo (%date%)(%time%) Crash or Close detected!

echo (%date%)(%time%) %servername% is now restarting...
>> %servername%_Guardian.log echo (%date%)(%time%) %servername% is now restarting...

::Server crashed or closed, so we point it to the return point to start the server again
goto restart


Attached Files
.zip   SRCDS Guardian 2.zip (Size: 987 bytes / Downloads: 474)
~ 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
#2
Would it be possible to run multiple servers using this batch file? If yes, how do you set it up? Just wondering...I tried experimenting with the other SRCDS Guardian.
Earn Points, get Free Rewards with your Amazon Points!
Points2Shop

Reply
#3
It is posibal modding it so it can, if I get time i will have a look at it tonight.
Good Job Mooga!
~ trewq
Reply
#4
Just have one batch files per server.
Set the server name and command line. All my servers use SRCDS Guardian. With HL servers, make sure the batch file is in the game folder Wink
~ 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
#5
Ghost Assassin, you could make one "master" batch file that executes all the specific server batch files. So when you execute the master batch file all your servers will start up.
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
Reply
#6
Seems cool. Smile
Derek Denholm, CEO, XFactorServers, INC.
XFactorServers: Game Server Hosting Solutions
Follow Us http://www.Twitter.com/XFactorServers
Reply
#7
You have to have a user logged in to the box running the batch file though. And if you run it as a service, I don't think killing the service will close the srcds processes. You could use something like this instead. You don't need someone logged into the box (saves RAM).

The batch file is nicely written Wink
A+
Reply
#8
I am getting an error running this. It starts the server fine but it says it couldnt find the path but I know its correct...
Derek Denholm, CEO, XFactorServers, INC.
XFactorServers: Game Server Hosting Solutions
Follow Us http://www.Twitter.com/XFactorServers
Reply
#9
Hey I got this working but have one problem, I run servers on different cores of the system and when SRCDS Guardian reboots the server it defaults to all cores. Any one to make it default to s specific core?
Jim
CEO
Co-Founder
Veloci Servers
¤ø„¸¨°º¤ø„¸ ¸„ø¤º°¨¸„ø¤º°¨
¨°º¤ø„¸ Hardstyle ¸„ø¤º°¨
¸„ø¤º°¨ Q Dance ``°º¤øFrom Ireland
Reply
#10
Any ideas to my above question?
Jim
CEO
Co-Founder
Veloci Servers
¤ø„¸¨°º¤ø„¸ ¸„ø¤º°¨¸„ø¤º°¨
¨°º¤ø„¸ Hardstyle ¸„ø¤º°¨
¸„ø¤º°¨ Q Dance ``°º¤øFrom Ireland
Reply
#11
In you are using window server, you can use the affinity command. For XP (or vista) you would need to install a third part program (to my knowledge)
~ 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
#12
Okay, I have translated it into Danish Smile.


.zip   SRCDS Guardian 2- Danish Version.zip (Size: 1.06 KB / Downloads: 4)

Code:
::=======================::
::  SRCDS Guardian 2.0   ::
::         Mooga         ::
::       srcds.com       ::
::=======================::

::=========================================================::
:: Tak til Black-Sky & Drocona for at lave SRCDS Guardian  ::
:: Dansk oversættelse er oversat af realchamp              ::
:: Dette script er en open source.                         ::
:: Du er velkommen til at redigere efter behag             ::
::                                                         ::
:: Dette script blev skrevet til brug for srcds.com        ::
:: online samfund.  Hvis du er interesseret i at køre en - ::
:: Source Dedicated Server eller mangler hjælp, så smut -  ::
:: forbi vores på ... http://forums.srcds.com              ::
::=========================================================::



:: Dette vil køre kommando prompten's vindue rent og nemt at læse
@echo off

::=======================::
::  SÆT DINE VARIABLER!  ::
::=======================::

::=======================::
::  Vindue og log navn   ::
::  Skift "Min Server"    ::
::=======================::
set servername="Min Server"

::=======================::
::   Din start kommando  ::
::=======================::
set runcmd=C:\hl2server\orangebox\srcds.exe -console -game tf -maxplayers 24 +fps_max 200 -port 27015 +map ctf_2fort -tickrate 66

:: Dette vil give vinduet en titel
title SRCDS Guardian 2.0   %servername%


:: Rydder vinduet i et tilfælde at der er skulle være noget
cls


:: Skriver i vinduet hvad vi laver
echo SRCDS Guardian 2.0 er nu startet!
echo.
echo **********************************************************************
echo For at lukke serveren, luk dette vindue og skriv exit i server vinduet
echo **********************************************************************
echo.
echo.

>> %servername%_Guardian.log echo.
>> %servername%_Guardian.log echo (%date%)(%time%) SRCDS Guardian 2.0 er nu startet!

echo (%date%)(%time%) %servername% starter nu op...
>> %servername%_Guardian.log echo (%date%)(%time%) %servername% starter nu op...

:: Dette er en tilbagevenden punkt i tilfælde af, at serveren går ned eller er blevet lukket ned
:restart

echo (%date%)(%time%) %servername% er nu online
>> %servername%_Guardian.log echo (%date%)(%time%) %servername% er nu online

echo Overvåger nu %servername% for nedbrud...
>> %servername%_Guardian.log echo (%date%)(%time%) Overvåger nu %servername% for nedbrud...

:: Start selve serveren
start /wait %runcmd%

echo (%date%)(%time%) Nedbrud eller nedlukning opdaget!
>> %servername%_Guardian.log echo (%date%)(%time%) Nedbrud eller nedlukning opdaget!

echo (%date%)(%time%) %servername% genstarter nu...
>> %servername%_Guardian.log echo (%date%)(%time%) %servername% genstarter nu...

:: Serveren lukkede ned eller blev lukket, så vi vil nu tilbagevende den til det tilbagevendende punkt for at starte serveren igen.
goto restart
Reply
#13
This is a great tool, love it Big Grin
Jim
CEO
Co-Founder
Veloci Servers
¤ø„¸¨°º¤ø„¸ ¸„ø¤º°¨¸„ø¤º°¨
¨°º¤ø„¸ Hardstyle ¸„ø¤º°¨
¸„ø¤º°¨ Q Dance ``°º¤øFrom Ireland
Reply
#14
Vista's start command (atleast biz ver) lets you set affinity via a commandline switch. Both OS's will let you set process priority via a switch as well.
Manage your redirects/fast downloads with one click! SourceRSC and HL1RSC
Need a free web based game server hosting panel? Check out UGCC.
Reply
#15
i'm a little confused here, i tried moving my steam folder to different places to get this to work, but it keeps saying "cannont find C:\Steam\steamapps\myusername\source" when the whole folder is C:\steam\steamapps\mysuername\source dedicated server\srcds.exe. I'm trying to get this for hl2dm. can someone please help!!!!

My Batch File looks like this: (I did change the directory)

::=======================::
:: SRCDS Guardian ::
:: Black-Sky ::
:: Drocona ::
::=======================::


::This will make the window clear, remove all paths etc, just to keep the important stuff
@echo off


::Give a name to the window, nothing really important.
title SRCDS Guardian by Drocona, Black-Sky


::Clear the window
cls


::Report to console what we are doing
echo ****To close this script, close the SRCDS window and type "Y"****

echo.
echo.
echo Watching the SRCDS for crashes

>> Guardian.log echo.
>> Guardian.log echo (%date%)(%time%) Started up SRCDS Guardian.


::If you are using the FPSbooster use this to start it up
echo.
echo (%date%)(%time%) Starting FPSbooster.

>> Guardian.log echo (%date%)(%time%) Starting FPSbooster.


start C:\SRCDS\srcdsfpsboost.exe


echo (%date%)(%time%) FPSbooster online.

>> Guardian.log echo (%date%)(%time%) FPSbooster online


::Insert a return point if it crashes
:srcds


echo (%date%)(%time%) SRCDS online.

>> Guardian.log echo (%date%)(%time%) SRCDS online.


::Start the actual server
start /wait C:\scrds\srcds.exe = -console -game hl2dm -tickrate 45 -ip 192.168.1.3 -port 27015 -maxplayers 20 +map bfcs_lobby_v2 +mp_dynamicpricing 0 +sv_Cheats 1 +sv_infinite_aux_power 1 +mp_flashlight 1


echo (%date%)(%time%) Server crashed or closed, restarting...

>> Guardian.log echo (%date%)(%time%) Server crashed or closed, restarting...


::Server crashed or closed, so we point it to the return point to start the server again
goto srcds
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)