GLaDOS - LAN Party Game Server
GLaDOS hosts the game servers at the LAN party. This usually includes Source game servers which require HLDS (see this post for more info).
The following folder structure is a guideline for where the game servers are installed for GLaDOS. The ~ indicates the home folder in ubuntu. The folder called hlds is where the game servers are installed. Important locations within these installations are talked about in more detail later on.
Starting, Managing & Stopping Servers
Navigate to "~/startfiles/tf2". Here you'll find the following scripts:
./6v6.sh start <number of servers> <map>
./6v6.sh start 4 cp_granary
will start four 6v6 match servers running cp_granary.
./6v6.sh send <"source console command">
./6v6.sh send "changelevel cp_badlands"
./6v6.sh send "say good luck have fun"
will send the quoted console commands to every tf2 6v6 server running. Note that changelevel will immediately change the level, and say will send text to the chat box.
No arguments required. This will issue tv_stoprecord to all tf2-6v6 servers so that any demos being recorded are closed properly before abruptly killing all tf2-6v6 servers with fire.
Tournament Server Settings
Some settings are defined in the start script, the rest are defined in a server config file. In this example we'll focus on 6v6.sh and server-6v6.cfg.
There's a lot going on here and you may want to paste the script into something that doesn't word-wrap. Here's a link to the a version of 6v6.sh (may be out of date). I'll try to explain section by section.
case "$1" in
The first argument of the script is inspected using a switch statement.
This syntax is used to start a series of TF2 6v6 servers.
screen -A -m -d -S $NAME-$c ~/hlds/tf2/orangebox/srcds_run ...
The line starting with the “screen” command is very long because it contains many server settings that are unique for each server. So, in order:
The server port. Note that the STV port starts at 27020, so you can only have up to 5 servers before something horrible happens.
The map to use (not unique for each server, but specified by you as the second argument in the script ($3)
Points to the server config file containing settings specific for 6v6. See below for details on server-6v6.cfg
+hostname \”TF2 Match Server $c\”
The name of the server (i.e. the first server will be called “TF2 Match Server 1”).
The Source TV server port
+tv_name \”Spectate TF2 Server $c\”
The name of the Source TV server (I.e the second STV server will be called “Spectate TF2 Server 2”)
Navigate to “~/hlds/tf2/orangebox/tf/cfg”. Here you'll find config files. The config file for a 6v6 server is named server-6v6.cfg. This file defines the behaviour of any server started by the 6v6.sh script (because that script contains the srcds_run option “+exec server-6v6.cfg”). The behaviour I'm talking about is stuff like server gravity, class limits... If you're wondering how we came to a decision on these settings, we borrowed ideas from the professional gaming league ETF2L. Open the file and have a read – it should mostly be self explanatory, if not, have a google.
The Hidden Servers
Starting servers for The Hidden: Source can be done using a script located in the startfiles folder.
./hidden.sh <number of servers>
The script will start as many servers as specified starting from port 27030, map=hdn_docks, maxplayers=6.
Navigate to "~/startfiles/l4d2". Here you'll find the following scripts:
./vssurv.sh <# of servers>
will start two L4D2 Versus Survival servers.
Updating/Installing servers on GLaDOS
There's a script for updating a hlds game in a screen. It's not been around long so it may not work so well. Here's how to use it:
./installgame.sh <Dedicated Server Name Enumeration> <Install Directory>
A screen will start in the background updating the game. See here for a list of correct server name enumerations:
Updating/installing servers manually
Navigate to "~/hlds" then run:
./steam -command update -game "<name>" -dir "<dir>"
Where <name> is the HLDS dedicated server name which can be found here.
./steam -command update -game "left4dead2" -dir "l4d2"
Will install/update a L4D2 server at "~/hlds/l4d2"
Updating/Installing servers manually using screens
Alternatively you can attach this process to a screen (the same way servers are attached to a screen - see 'Starting and Stopping Source Servers' for more info on screens)
Start a new screen (note the capital S):
screen -S update
And do what you want to do in this new screen called update.