Post Reply  Post Thread 
Make "exit" or "quit" re-start a server
Author Message
Mooga
TF2 Server Admin
******


Posts: 759
Group: Super Moderators
Joined: Oct 2007
Status: Offline
Reputation: 0
Post: #1
Make "exit" or "quit" re-start a server

Q: How can I make the "exit" or "quit" command restart my server?
A: In windows this can be done via a batch script. This can also be done in a similar method in linux.

Below is an example of an auto-restart script.
Change "GAME" to your game and the start-up command to your start-up command Smile

Code:
::=======================::
::    SRCDS Guardian     ::
::      Black-Sky        ::
::       Drocona         ::
::                       ::
::   EDITED FOR DEFRAG   ::
::       BY MOOGA        ::
::                       ::
::      TF2 Version      ::
::=======================::


::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               My GAME Server


::Clear the window
cls


::Report to console what we are doing
echo ****To close this script, close this windows and then the SRCDS window****

echo.
echo.
echo Watching the GAME SRCDS for crashes

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

::Insert a return point if it crashes
:srcds


echo (%date%)(%time%)        GAME Server is now online.

>> GAME_Guardian.log echo (%date%)(%time%)        GAME Server is now online.


::Start the actual server
start /wait C:\hl2server\orangebox\srcds.exe -console -game tf -maxplayers 24 +fps_max 200 -port 27015 +map ctf_2fort -tickrate 66


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

>> GAME_Guardian.log echo (%date%)(%time%) GAME Server crashed or closed. Now restarting...


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


~ Mooga

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: 05-10-2008 06:10 AM by Mooga.

05-08-2008 09:35 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: