hl2_logo

My Aim here is not to write from scratch what you cannot already find by using Google but rather try and get it all in one place. Half Life 2 Death Match can be gained for Free – so first let us get that:

For ATI/AMD (Radeon) graphic card users: installstorefront

For Nvidia (GeForce) graphic card users: installstorefront

Now let us begin on our quest to get a server up and running on Linux, I am going to assume you have access to a Linux box to complete this part.

Getting the server files

mkdir srcds_l
cd srcds_l
wget http://www.steampowered.com/download/hldsupdatetool.bin
chmod +x hldsupdatetool.bin
./hldsupdatetool.bin
./steam

When you execute both ./hldsupdatetool.bin & ./steam – this can take some time and look like nothing is happening – this is quite normal.

Now we need to grab the file for the correct game:

./steam -command update -game "hl2mp" -dir .

This will take a while, go grab yourself a drink.

Server.CFG

We need to create a server.cfg file at this point, so fire up your favouite editor, in this case I shall use Joe:

cd hl2mp/cfg

joe server.cfg

Now we need to populate the file with the following:

// Server Name
hostname "Half Life 2 Server"

// Rcon Cvars
rcon_password "password" //Set’s remote control password

// Server Password
sv_password "" // Password protects server

// Server Cvars
mp_disable_autokick 1 //Prevents a userid from being auto-kicked
sv_allow_color_correction 0 //Allow or disallow clients to use color correction on this server.
sv_allow_wait_command 0 //Allow or disallow the wait command on clients connected to this server.
sv_alltalk 0 //Players can hear all other players, no team restrictions
sv_alternateticks 0 //If set, server only simulates entities on even numbered ticks.
sv_cheats 0 //Allow cheats on server
sv_clearhinthistory 0 //Clear memory of server side hints displayed to the player.
sv_consistency 1 //Whether the server enforces file consistency for critical files
sv_contact "************" //Contact email for server sysop
sv_pausable 0 //Is the server pausable.

sv_steamgroup_exclusive 1 // Setting to 0 will not connect to the Match Making Service
sv_steamgroup  // Family Steam Group Number

// Lan or internet play, Server region cvars
sv_lan 0 //Server is a lan server ( no heartbeat, no authentication, no non-class C addresses )
sv_region 3 // Region Codes: 0 – US East coast, 1 – US West coast, 2 – South America, 3 – Europe, 4 – Asia, 5 – Australia, 6 – Middle East, 7 – Africa, 255 – world

// HTTP Redirect
sv_downloadurl "http://yourserver.com"
sv_filetransfercompression 0

// Server Logging
sv_log_onefile 0 //Log server information to only one file.
sv_logbans 0 //Log server bans in the server logs.
sv_logecho 0 //Echo log information to the console.
sv_logfile 1 //Log server information in the log file.
sv_logflush 0 //Flush the log file to disk on each write (slow).
sv_logsdir "logs" //Folder in the game directory where server logs will be stored.

// bandwidth rates/settings
sv_minrate 0
sv_maxrate 25000
sv_minupdaterate 10
sv_maxupdaterate 33
sv_mincmdrate 10
sv_maxcmdrate 33
sv_client_cmdrate_difference 1
sv_client_predict 1
sv_client_interpolate 1
sv_client_min_interp_ratio -1
sv_client_max_interp_ratio -1

sv_rcon_banpenalty 60
sv_rcon_maxfailures 10
sv_rcon_minfailures 5
sv_rcon_minfailuretime 45

sv_allow_lobby_connect_only 0

// Voice Comm
sv_voiceenable "1"
sv_voicecodec vaudio_speex

// Exec Configs
exec banned_user.cfg
mapchangecfgfile server.cfg
mapcyclefile mapcycle.txt

Map File Downloading

A Special mention for the Map file site – sv_downloadurl – This tells the server were to find the files to send to the user. On a dedicated host (web server) – create a folder called HL2DM for example and inside this we need maps, sound, models and so forth (depending on the requirements of the map). You then point the variable to http://www.yourserver.com/HL2DM for example.

Creating the MapCycle File

In the same directory, we need a file called mapcycle.txt, this will list the maps the server will use. You fill it out like this:

dm_intel_inside
dm_balcony_beta2
dm_gulch
dm_killbox_final
dm_killbox_kbh_2
dm_neon

Server run Command

Go back to the srcds_l folder and create a new file called server.sh (joe server.sh)

#!/bin/sh
echo "Starting HL2DM Server"
sleep 1
screen -A -m -d -S hl2dm ./srcds_run -console -game hl2dm +map dm_gulch +maxplayers 16 –autoupdate

Now chmod +x server.sh

Running the server

To run the server, simply type ./server.sh and it will say running the server and come back to the command line, this is now running in the background. To view the server screen, type screen –x hl2dm

To jump between screens you need to Press CTRL+A, N and CTRL+A,C to create a new one etc.