Source Dedicated Server
The Source Dedicated Server is Valve's software for running any game server that uses the Source Engine. It is often abbreviated as HLDS. Setting it up is pretty simple, it gets complicated once you start adding in mods and custom configurations, however. Following is a guide on how the base TF2 installation is set up on GlaDoS.
Getting the Steam Updater
First we want to be in our home directory:
chmod +x hldsupdatetool.bin
chmod +x steam
Management of Different Source Games
HLDS is not a very well designed system in practice. It is messy and confusing at times. One of the most annoying issues is you cannot have two instances of the same game installed to a single installation of HLDS (i.e. you can't have two installations of TF2). To handle this, you simply install multiple versions of HLDS. To keep things nice and clean on GlaDoS, every game has its own installation. For example our home directory might look like this:
Installing an HLDS Game
In this example we are going to be installing a regular server of TF2. To comply with what was just said above with folder naming conventions, let's make a folder called tf2-main:
./steam -command update -game "tf" -dir "tf2-main"
Starting and Stopping Source Servers
Source servers are started using the srcds_run file. In the filesystem outlined above, it would be located at ~/tf2-main/orangebox/srcds_run. To just simply run the server you can type the following:
./tf2-main/orangebox/srcds_run -game tf
As well as screens we also use something called taskset when running the game servers. This allows you to bind the server to a single core on the CPU, meaning you can spread the load out across the processor and other games won't interfere. It is a good idea to make sure you don't have multiple games running on one core unless absolutely necessary.
With screens and taskset added, our launch command now looks like this:
screen -A -m -d -S tf2-main taskset -c 0 ./orangebox/srcds_run -game tf +map pl_upward +maxplayers 19 +ip 18.104.22.168 +exec server-default.cfg -autoupdate -verify_all
Put this command in a file inside the tf2-main folder:
<paste command into file and save>
chmod +x tf2-main.sh
screen -r tf2-main
You can list running screens by typing
Config File Trivia
Config files for source servers can be very painful to setup and configure. It gets most complicated when you want to have multiple configs available server installation.
In relation to our file system outlined above, configs are located in ~/tf2-main/orangebox/tf/cfg/. By default, the Source Server will look for server.cfg in this folder when it is run. If this is present it will be run, regardless of whether you put +exec in the startup. This is obviously going to be an issue if you want to run different configurations. To get around this, do not call any config files server.cfg, and make sure to use +exec in the server start command to specify a new one. You will note in the section above that server-default.cfg is used.
Basic Config Files
Config files differ between different Source Servers. TF2 is very different to L4D2 - they are not interchangeable in any way. For TF2 you can find the configuration options here: http://tf2wiki.net/wiki/Dedicated_server_configuration .
explosivose likes this.