Even though there is some information on how to setup a dedicated server source server on a Linux based system the articles are often old or to generic for my liking. I have written this article to help other people setup a Day of Defeat source (DOD:S) server on a Ubuntu 8.04.1 system.
Downloading the software from steampowered.com
The first thing to do is to download the Source Dedicated Server from steampowered. So on the linux server I create a folder on the dod user account and download the binary with the following commands.
dod@dirac:~$ mkdir srcds_l dod@dirac:~$ cd srcds_l dod@dirac:~/srcd_l$ wget http://www.steampowered.com/download/hldsupdatetool.bin
The next thing to do is to make the file executable and run the program.
dod@dirac:~/srcd_l$ chmod +x hldsupdatetool.bin dod@dirac:~/srcd_l$ ./hldsupdatetool.bin dod@dirac:~/srcd_l$ ./steam
Now the basic part is installed and need to download and install DOD:S.
dod@dirac:~/srcd_l$ ./steam -command update -game dods -dir .
If I wanted something like CS:S instead I would replace dods with “Counter-Strike Source”.
In stead of issuing a series of command every time I wish to start the server I run the following shell script.
#!/bin/bash cd srcds_l ./steam -command update -game dods -dir . # This updates dods file to latests version before launching the game. cd orangebox ./srcds_run -console -game dod +map dod_kalt +maxplayers 24 +ip 192.168.1.153 -port 27015 -autoupdate -pingboost 1 -debug # This starts the server and sets some obvious settings. Notice the strange syntax with a plus in front of ip but a minus in front of port.
If the server is behind a router as mine is you need to forward some ports to the server:
- UDP 1200 (Friends Network)
- UDP 27000 to 27015 (Gameport)
- UDP 27020
- TCP 27030 to 27039
- TCP 27015 (SRCDS Rcon port)
The next logical thing to do is to edit the server.cfg. It should be created in
Most of these entrys are self explanatory.
hostname "1337 |-|4xor DODS server" sv_contact "email@example.com" rcon_password "verysecret" //sv_password "somewhat secret" //SETTINGS sv_visiblemaxplayers 24 // Overrides the max players reported to prospective clients sv_lan 0 // This is not a Lan server sv_secure 1 // No cheats! sv_cheats 1 // No cheats sv_region 3 // Region 3 is europe sv_unlag 1 sv_rcon_minfailures 2 sv_rcon_maxfailures 3 sv_rcon_banpenalty 0 (permanent ban} sv_rcon_minfailuretime 30 sv_logbans 1 sv_filterban 1 log "on" // creates a logfile sv_logfile 1 sv_log_onefile 1 //only one log file sv_allowDownload "1" // enables or disables direct client downloads from server. sv_dl_maxRate "250000" // sets the max rate in bytes/s for direct client downloads. 250000 B/S = 244.KB/s net_maxfilesize 500 // The maximal filesize in mb for the client to download from the server. mp_friendlyfire 1 mp_timelimit 30 // 30 minute timelimit mp_autokick 7 // Kick idle players dod_bonusround 0 // Winning team cant kill losers //mapcyclefile "mapcycle.txt"
Adding more maps
To install a map such as dod_arnhem the first thing to do is to download the zip/rar file from some webserver such as
DOD:S maps [fpsbanana.com]
and then unpack the bsp files in to the folder /srcds_l/orangebox/dod/maps/
dod@dirac:~/srcds_l/orangebox/dod/maps$ unrar -e dod_strand.rar
If the zip files contains new sounds or models these files should be moved to the appropriate path in /srcds_l/orangebox/dod/.
Running the server
When running the game, one can connect to the server and use rcon to administer the server. Once connected to the server start the in-game console and the following to connect.
I should then be logged in a be able to do all sorts of nice things on the server. Every command should start with “rcon” when working on the server.
- rcon say [text]
Say something in-game as Console: [text]
- rcon changelevel [map]
Change the level of play (Example: dod_palermo)
- rcon stats
This will show a table with CPU usage and stuff on the server.
- rcon restartgame [x]
This will restart the game (NOT the server) in
- rcon quit
This terminates the server.
- rcon kickid [number]
Kick someone from the game, using the UserID or SteamID.
- rcon users
Show user info for players on server.
- rcon banid [x] [y] kick
Ban [x] in minutes (0=permanent) [y] User or SteamID.
- rcon addip [x] [z] kick
Ban by IP [x] same as above [z] IP-address of player.
- rcon removeid [p]
Remove ban for [p] by SteamID.
- rcon removeip [q]
Remove ban for [q] by IP-address.
- rcon writeid
Saves all the banned SteamID’s.
- rcon writeip
Saves all the banned IP-addresses.