Can't get enough SRCDS.com? Follow us on: Twitter | IRC | Steam


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

SRCDS Guardian 2.0 - Keep your server running

Author Message
Mooga Offline
Super Awesome Admin

Posts: 3,509
Joined: Oct 2007
Reputation: 19
Post: #1
SRCDS Guardian 2.0 - Keep your server running
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 File(s)
.zip  SRCDS Guardian 2.zip (Size: 987 bytes / Downloads: 279)

~ Mooga ...w00t? - SRCDS.com on Twitter
[Image: mooga.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.
(This post was last modified: 02-17-2010 04:58 AM by Mooga.)
09-04-2008 09:52 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Ghost Assassin Offline
Regular Member

Posts: 150
Joined: Mar 2008
Reputation: 0
Post: #2
RE: SRCDS Guardian 2.0 - Keep your server running
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.

[Image: b_560x95.png]
Earn Points, get Free Rewards with your Amazon Points!
Points2Shop
09-04-2008 01:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Goilio Offline
THE Cool Moderator

Posts: 909
Joined: Feb 2008
Reputation: 9
Post: #3
RE: SRCDS Guardian 2.0 - Keep your server running
It is posibal modding it so it can, if I get time i will have a look at it tonight.
Good Job Mooga!

Footprint Gaming
Do not PM me for help

Code:
while true; do echo -n "Goilio "; done
09-04-2008 01:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Mooga Offline
Super Awesome Admin

Posts: 3,509
Joined: Oct 2007
Reputation: 19
Post: #4
RE: SRCDS Guardian 2.0 - Keep your server running
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: mooga.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.
09-04-2008 02:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Drocona Away
Forum admin

Posts: 5,159
Joined: Mar 2005
Reputation: 20
Post: #5
RE: SRCDS Guardian 2.0 - Keep your server running
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
09-05-2008 04:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Derek Offline
Senior Member

Posts: 256
Joined: May 2008
Reputation: 0
Post: #6
RE: SRCDS Guardian 2.0 - Keep your server running
Seems cool. Smile

Derek Denholm, CEO, XFactorServers, INC.
XFactorServers: Game Server Hosting Solutions
Follow Us http://www.Twitter.com/XFactorServers
10-01-2008 09:15 PM
Find all posts by this user Quote this message in a reply
recon0 Offline
Newbie

Posts: 8
Joined: Oct 2008
Reputation: 0
Post: #7
RE: SRCDS Guardian 2.0 - Keep your server running
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+
(This post was last modified: 11-01-2008 07:25 PM by recon0.)
11-01-2008 07:24 PM
Find all posts by this user Quote this message in a reply
Derek Offline
Senior Member

Posts: 256
Joined: May 2008
Reputation: 0
Post: #8
RE: SRCDS Guardian 2.0 - Keep your server running
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
11-07-2008 01:44 PM
Find all posts by this user Quote this message in a reply
ComputerHelper Offline
Banned

Posts: 1,006
Joined: Feb 2008
Reputation: 14
Post: #9
RE: SRCDS Guardian 2.0 - Keep your server running
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
01-04-2009 11:25 PM
Find all posts by this user Quote this message in a reply
ComputerHelper Offline
Banned

Posts: 1,006
Joined: Feb 2008
Reputation: 14
Post: #10
RE: SRCDS Guardian 2.0 - Keep your server running
Any ideas to my above question?

Jim
CEO
Co-Founder
Veloci Servers
¤ø„¸¨°º¤ø„¸ ¸„ø¤º°¨¸„ø¤º°¨
¨°º¤ø„¸ Hardstyle ¸„ø¤º°¨
¸„ø¤º°¨ Q Dance ``°º¤øFrom Ireland
01-06-2009 03:39 AM
Find all posts by this user Quote this message in a reply
Mooga Offline
Super Awesome Admin

Posts: 3,509
Joined: Oct 2007
Reputation: 19
Post: #11
RE: SRCDS Guardian 2.0 - Keep your server running
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: mooga.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.
01-09-2009 06:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
realchamp Offline
Bæver klubben

Posts: 6,128
Joined: May 2008
Reputation: 60
Post: #12
RE: SRCDS Guardian 2.0 - Keep your server running
Okay, I have translated it into Danish Smile.


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

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
(This post was last modified: 01-25-2009 09:45 PM by realchamp.)
01-25-2009 06:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ComputerHelper Offline
Banned

Posts: 1,006
Joined: Feb 2008
Reputation: 14
Post: #13
RE: SRCDS Guardian 2.0 - Keep your server running
This is a great tool, love it Big Grin

Jim
CEO
Co-Founder
Veloci Servers
¤ø„¸¨°º¤ø„¸ ¸„ø¤º°¨¸„ø¤º°¨
¨°º¤ø„¸ Hardstyle ¸„ø¤º°¨
¸„ø¤º°¨ Q Dance ``°º¤øFrom Ireland
01-25-2009 06:23 AM
Find all posts by this user Quote this message in a reply
Masher Offline
Regular Member

Posts: 108
Joined: Jan 2007
Reputation: 0
Post: #14
RE: SRCDS Guardian 2.0 - Keep your server running
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
FPSbooster as a windows service. Free and with source.
Need a free web based game server control panel? Check out UGCC.
02-11-2009 12:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
burns-o Offline
Junior Member

Posts: 15
Joined: Feb 2009
Reputation: 0
Post: #15
RE: SRCDS Guardian 2.0 - Keep your server running
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
(This post was last modified: 02-15-2009 12:31 AM by burns-o.)
02-15-2009 12:27 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump: