General
Legends Website
Tutorial & Skiing
Legends FAQs
Player Configuration
Legends Teams List
How to Host
Server List Backup

Add-Ons
New Maps
New Skins
New Voices
Player Scripts
Server Scripts & Mods

Modding
Legends Mapping Guide
Legends Scripting Guide
Creating Team Skins
Creating Voice Packs

Gameplay Guide
Legends Guide

Linux
Installation Instructions
Installer Script
Package Creator Scripts
Legends Distro Status

Game Server Admin

This page contains information on hosting a Legends game server. Hosting your own server will allow you to run your favourite Mods and Maps.

How to setup a Legends Dedicated Server

“Dedicated Server” means that game will always be running so that players can join. It is usually a command line application running on a Linux Server computer somewhere with a very fast network connection. Admins log in using Telnet or SSH and set it up or reboot it. Using scripts and other tools it is set up to reboot after crashing and load after system startup. Various UDP/TCP Ports need to be opened. If you have experience hosting Tribes 2 servers or other fps games, this is similar and easy.

Minimum Recommended Specs: 1Ghz CPU, 1 GIG RAM, broadband connection, dedicated machine (not doing anything else).

Windows

Legends servers are auto sensing, they arent bound to one particular PORT, setting up the dedicated server for legends is very simple, go to your desktop (or wherever) right click, and select new/shortcut, you then want to place this in the shortcut properties, please note if you installed legends in a wierd place like C:/programfiles/mysuperfiles/morefiles and so on, you will have to adjust the path accordingly

Windows Shortcut Icon Properties
C:\Legends2\Legends.exe -dedicated

Hit OK and your new shortcut is done. If all went well, a shortcut with a Legends icon should be there. If you wish to start on a specific mission you may add -mission legends/data/missions/CTF_Sol.mis, as below.

C:\Legends2\Legends.exe -dedicated -mission legends/data/missions/CTF_Sol.mis
Editing Server Settings (serverprefs.cs)

The Server's settings file is saved during when it has Quit ( either typing quit(); in console or quitting from hosting in the GUI). So you need to follow the process below and then you will get a serverprefs.cs file.

  1. Boot up your server once, let it boot all the way until it gets past “engine initialized...” then shut it down by typing “quit();”. If you crash the process you won't get a serverprefs.cs file.
  2. Open your C:/Legends/legends/prefs/serverprefs.cs file using notepad or any text editor like TribalIDE (color of different script pieces etc) use Tribal IDE

Linux

This is a simple auto-restarter script for Linux, instead of using the traditional 'ispawn' method because ispawn could crash your server unless you specified -nosleep.

Step 1

Open your system command line window. Start a new “screen” (basically a new console instance).

screen

Set the Legends directory with the binary files as your working directory.

cd legends

Step 2

paste this into your console,

while true
do
./update
sleep 5
DATE=`date`
echo "$DATE lindedicated has started"
./lindedicated -dedicated
DATE=`date`
echo "Warning: Server has crashed, or been stopped. Restarting."
done

Your dedicated server should start up, you will see it load scripts and start reporting to the Master Server.

Step 3

Press CTRL-a and then hit d to detach from the “screen”, you will return to your normal console. If you type 'Exit' instead, your server will stop because the “screen” has been closed.

Note: “CTRL-c” to cancel your current process, “ps ux” to list Process Status of your own running programs in linux, “kill -p 123” to quit the process with PID of 123 (listed in “ps ux”).

Auto-Start Linux Legends Server at boot time, Ubuntu, Debian based

You will be creating a file in your boot scripts and pasting code to start a Legends server without logging output to the main console. This will be different on other Distributions.

sudo mousepad /etc/rcS.d/S91legends.sh &

Which will open your text editor with the filename we will be using and paste the following

#!/bin/sh
export  LD_LIBRARY_PATH=./
cd /home/YOURLINUXUSERNAME/legends
su -c "./lindedicated -dedicated -log 0 -perfcounter 0" YOURLINUXUSERNAME &

Save it and reboot. Done.

Note: If you want to delay execution of a linux command (similar to WAIT in DOS) you can use brackets and sleep, like below. It will wait 60 seconds, then do the command after the semicolon(;), the ampersand(&) outside the brackets hides the output from the console.

(sleep 60; su -c "./lindedicated -dedicated -log 0 -perfcounter 0" YOURLINUXUSERNAME)&

If later you want to prevent the autostart script (remove the file), do this. Also you could put a hash(#) at the start of each line as a way to stop script commands from executing.

sudo rm /etc/rcS.d/S91legends.sh

Use the top command in console window to list running processes. CTRL-C or q to quit viewing processses.

Explanations: rcS.d is a startup scripts directory, all script filenames start with 's' and a number up to 100, higher numbers are loaded last and this folder is loaded last - so our script will most likely be last thing to load. sudo is SuperUser Do, which performs commands as the highest security level - because editing your startup files is dangerous, it will ask you for your password. The & symbol at the end of a line keeps your console active without waiting for the process to quit, so you can enter more commands in the same console window. su -c will start the lindedicated process in a background window as if executed by the specified USER which is at the end of the line. -log 0 is a Legends command which will turn off logging, 1 will enable logging in APPEND mode and eventually create a big log file, 2 will enable logging in OVERWRITE mode, which replaces the logfile on server start. rm is Remove File. cd is Current Directoy.

Server Settings

  • serverprefs.cs: Server Settings, Ports, Team Names, MOTD, Vote, Admins, Mission Time

Legends Dedicated Command line switches for Lindedicated in Linux and Legends executables in Windows

  • -help : displays some Help.
  • -nosleep, -zerosleep, -sleep : Only -zerosleep seems to be worth using, the others usually cause worse performance.
  • -dedicated : Loads up the server in dedicated mode, which is a simple looking DOS style console window.
  • -mission legends/data/missions/CTF_Sol.mis : specifies a starting mission. Will not work if using customMapCycle
  • -log 0 : disables the Log file.
  • -log 1 : enables log file in append mode, an ever-increasing log file.
  • -log 2 : enables log file in overwrite mode, wiping the log file every at restart.
  • -perfcounter 0 : Disables performance tracking code, usually this is off by default but this just makes sure your server will be running at full speed.
  • -mod yourmod : load the scripts from the '/yourmod' folder as sets the mod name of your server to 'yourname' instead of 'variant'.
  • -trace : turn on detailed program feedback. This will show every command being executed by the scripts and the engine, producing a massive log file and slowing performance. But it is very handy for tracking down problems. This can also be enabled in the console using trace(1); and disabled with trace(0);
  • -echoload : This displays all file accessing as the server loads and checks files.

Server FAQs & Errors

 
server/index.txt · Last modified: 2009/11/19 17:48 by terrox