Home
Remote Server Admin

This is basic information on how to maintain a Server via FTP and WebAdmin.

The Batch File

This is probably the most important requirement you will need to maintain your Server.

A Typical Batch File
For WinNT - Win2K - WinXp

@echo off
loop:
ucc server DM-Antalus?Game=XGame.xDeathMatch -server -ini=UT2004.ini -log=Server.log
copy Server.log Servercrash.log
goto loop


For Win98 - WinME

@echo off
loop:
start /w ucc server DM-Antalus?Game=XGame.xDeathMatch -server -ini=UT2004.ini -log=Server.log
copy Server.log Servercrash.log
goto loop


The Batch file is very configurable if you know how, but caution is the order of the day.
"Hot" batch files can be changed and altered as required provided you obey the rules.
Under normal operating conditions the "Hot" line is the ucc server command line.
This line can be altered to anything you like provided you do not in anyway change the length of the line.
For instance:
ucc server DM-Antalus?Game=XGame.xDeathMatch -server -ini=UT2004.ini -log=Server.log
can be changed to:
ucc server CTF-Maul?Game=XGame.xCTFGame        -server -ini=UT2004.ini -log=Server.log
and as you can see the line length has not been changed. Just add spaces to get the line the right length.
You can now upload the new Batch file overwriting the existing one without worry and restart the server.

Any lines after the commandline can be changed without worring about the length, also new lines can be added.
This I will demonstrate with the following example and this is the method I use on my 4 servers.

A tip when creating the server startup batchfile.
Add 4 spaces between the xDeathMatch and the -server. I will explain the reason later.

Example
@echo off
loop:
ucc server DM-Antalus?Game=XGame.xDeathMatch         -server -ini=UT2004.ini -log=Server.log
copy Server.log Servercrash.log
goto loop


Now we need to change this batch file so we can test Mods, Mutators etc with saftey in mind.
Remember if you crash the server, you are not there to restart it but probably a 1000 kilometers away :-)

So lets say you got hold of a Mutator that you want to test - MyTestMut
First upload the Mutator onto the server.
Now you need to alter the batch file, so download the existing batchfile and change it as follows:

@echo off
loop:
ucc server DM-Antalus?Game=XGame.xDeathMatch         -server -ini=UT2004.ini -log=Server.log
ucc server DM-Antalus?Game=XGame.xDeathMatch?Mutator=MyTestMut.MyTestMut -server -ini=UT2004.ini -log=Server.log
copy Server.log Servercrash.log
goto loop


So what do we see here... 2 commandlines and a UT2004.ini file ???
Let me explain this strange setup.
1. Your UT2004.ini file is your Default ini file and should never be changed and have no extra ServerPackages etc.
2. Copy the UT2004.ini to a UT2005.ini file and use this file for alterations like ServerPackages etc.
3. The second commandline is the commandline you use for testing just incase the mutator crashes your server.
    Should a crash occur, the server will loop back to the first default commandline.

Ok, I am sure by now you are starting to understand batchfiles.
Now lets say this Mutator works well and you now are happy and want this to be your main commandline.
This is where those 4 spaces come in handy we put in the first commandline.
Remember, we cannot change the line lengths on the "Hot" commandline or any previous lines.
So now we remove the 4 spaces and add the word Rem followed by a space at the start as follows:

@echo off
loop:
Rem ucc server DM-Antalus?Game=XGame.xDeathMatch -server -ini=UT2004.ini -log=Server.log
ucc server DM-Antalus?Game=XGame.xDeathMatch?Mutator=MyTestMut.MyTestMut -server -ini=UT2004.ini -log=Server.log
copy Server.log Servercrash.log
goto loop


This will remark out the first commandline and only the second one will work from now on.

At some later stage, should you want to add more Mutators, you simply remove the Rem and its space and then add the 4 spaces back somewhere else, restart your server so the first default commandline is executed. You can now go change the second commandline together with its UT2004.ini file to what you want and restart your server.




Restarting a Server

There are 2 ways of doing this remotely - Ingame and WebAdmin with WebAdmin being the main choice:

InGame

Join the Game and login as ServerAdmin:
Adminlogin username password
Admin Exit


WebAdmin

Get WebAdmin going and click on Console.
In the message line at the bottom, remove the word Say and type in Exit then click on send.




Stopping a Server

Often one needs to stop the Server to maybe upload a new patch or something.
What I did here was create myself a program called ProTimer.exe which sits on the server in the System folder.
ProTimer can be downloaded here

Using ProTimer

Ok to use ProTimer first we need to make a change to our Batch file by adding a line as follows:

@echo off
loop:
Rem ucc server DM-Antalus?Game=XGame.xDeathMatch -server -ini=UT2004.ini -log=Server.log
ucc server DM-Antalus?Game=XGame.xDeathMatch?Mutator=MyTestMut.MyTestMut -server -ini=UT2004.ini -log=Server.log
copy Server.log Servercrash.log
if exist ProTimer.ini start /wait ProTimer.exe
goto loop


Please Note: If the server is using Win98 then the /wait must be changed to /w

Now when you want to stop the server:
1. In the ProTimer.ini file set in minutes the maximum time you want the server to stop:

MaxTime=20

This will stop the server for 20 minutes, unless you delete the ProTimer.ini file.

2. Upload the file ProTimer.ini
3. Go into the WebAdmin Console, remove the word Say and type in Exit and hit send.

The batchfile will now see that ProTimer.ini exists and thus it will execute ProTimer.exe
At this point ProTimer.exe will store a file called ServerStopped.ini in the System folder and if you refresh with your FTP you will see this file confirming that the server has stopped.
Now you can change things to what you want.


Restarting the Server again:

If you dont do anything, ProTimer.exe will automatically timeout after MaxTime minutes that you set in the ProTimer.ini file before you uploaded it.
This is a precaution incase you loose connection or something.
OR
Just delete the ProTimer.ini file that you uploaded and the server will restart.
Refreshing you will see the ServerStopped.ini file has gone confirming the server has restarted.

On the server itself a window will be displayed with an option to quit ProTimer.exe but with a warning to the person wanting to quit.

The ProTimer.ini MaxTime= can be anything from 1 minute to 600 minutes (10 hours)

Any problems just contact me and I will try and help where necessary.




Linux Batch File

The batch file for a linux server uses the .sh extension and looks like this:
StartServer.sh

#!/bin/sh
while true
do ./ucc server DM-Antalus?Game=XGame.xDeathMatch -server -ini=UT2004.ini -log=Server.log
sleep 10
done