[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
howtos:software:halflife_dedicated_server [2013/03/09 16:09 (UTC)] – created alienbob | howtos:software:halflife_dedicated_server [2013/03/09 16:42 (UTC)] – Add section about custom maps. alienbob | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Installing a Half-Life Dedicated Server ====== | ====== Installing a Half-Life Dedicated Server ====== | ||
- | This article will guide you through the installation and configuration of a Half-Life Dedicated Server (HLDS). Half-life was [[http:// | + | This article will guide you through the installation and configuration of a Half-Life Dedicated Server (HLDS). |
Running a Half-Life server is fun for you and your friends. The Half-Life game is resource-friendly and fast -even on not-too-new hardware. Running a Half-Life server allows you to choose the list of maps which will be rotated on your server or other forms of customization (like password-protecting the server so that //you// determine who can join the games). | Running a Half-Life server is fun for you and your friends. The Half-Life game is resource-friendly and fast -even on not-too-new hardware. Running a Half-Life server allows you to choose the list of maps which will be rotated on your server or other forms of customization (like password-protecting the server so that //you// determine who can join the games). | ||
Line 51: | Line 51: | ||
$ ./ | $ ./ | ||
</ | </ | ||
- | * To download the Half-Life game server files, you login to your Steam server account: </code> | + | * To download the Half-Life game server files, you login to your Steam server account: < |
Steam> login < | Steam> login < | ||
</ | </ | ||
* Enter your password. Then check your e-mail for your Steam Guard access code and enter it (you will only need to do this once per computer). \\ You should see a message stating that you have successfully logged in with your account. | * Enter your password. Then check your e-mail for your Steam Guard access code and enter it (you will only need to do this once per computer). \\ You should see a message stating that you have successfully logged in with your account. | ||
- | * Set your server install directory. In this article, we will use a subdirectory "// | + | * Set your server install directory. In this article, we will use a subdirectory "// |
- | Steam> force_install_dir | + | Steam> force_install_dir |
</ | </ | ||
* Install or update the HLDS game server files. Every Steam application has its own "// | * Install or update the HLDS game server files. Every Steam application has its own "// | ||
Line 67: | Line 67: | ||
</ | </ | ||
- | This will have populated the " | + | This will have populated the "'' |
==== Starting the Game Server ==== | ==== Starting the Game Server ==== | ||
- | The // | + | The // |
You can start the Half-Life game server directly using the following commands: < | You can start the Half-Life game server directly using the following commands: < | ||
$ cd ~/ | $ cd ~/ | ||
- | $ ./hlds_run -game valve +maxplayers 4 +map CObase | + | $ ./hlds_run -game valve +maxplayers 4 +map crossfire |
</ | </ | ||
If your server is multi-homed (i.e. it has multiple IP addresses) or you want to run the server on a non-standard port, then you may be required to add commandlin parameters like "'' | If your server is multi-homed (i.e. it has multiple IP addresses) or you want to run the server on a non-standard port, then you may be required to add commandlin parameters like "'' | ||
+ | |||
+ | Check out the file "'' | ||
+ | // Show my contact email: | ||
+ | sv_contact " | ||
+ | |||
+ | // We report ourselves as an European server: | ||
+ | sv_region 3 | ||
+ | |||
+ | // default server name. Change to " | ||
+ | // hostname " | ||
+ | hostname "Alien BOB's server" | ||
+ | |||
+ | // Allow clients to download maps | ||
+ | sv_allowdownload 1 | ||
+ | |||
+ | // Allow clients to upload decals | ||
+ | sv_allowupload 1 | ||
+ | |||
+ | // LAN only play | ||
+ | //sv_lan 1 | ||
+ | |||
+ | // Use this if clients need a password to join: | ||
+ | // | ||
+ | </ | ||
Because this is a game server, you do not want to be forced to keep a terminal opened all the time while the server is running. Therefore it is much more convenient to run the server in a "'' | Because this is a game server, you do not want to be forced to keep a terminal opened all the time while the server is running. Therefore it is much more convenient to run the server in a "'' | ||
Line 84: | Line 108: | ||
#!/bin/bash | #!/bin/bash | ||
cd server/ | cd server/ | ||
- | screen -A -mdLS hlds_valve -c / | + | screen -A -mdLS hlds_valve -c / |
+ | ./hlds_run -console -game valve -pingboost 2 -pidfile hlds.pid \ | ||
+ | +sys_ticrate 1000 +sv_maxupdaterate 100 +ip 192.168.1.1 +port 27015 +maxplayers 4 +map crossfire +cpu 1 | ||
EOT | EOT | ||
$ chmod +x / | $ chmod +x / | ||
$ cat << EOT > / | $ cat << EOT > / | ||
log on | log on | ||
- | logfile / | + | logfile / |
EOT | EOT | ||
</ | </ | ||
Line 104: | Line 130: | ||
It is good practice to let the Steam components update themselves. You can use a cron job to run an update once a day. | It is good practice to let the Steam components update themselves. You can use a cron job to run an update once a day. | ||
- | Create a wrapper script which updates the game(s) automatically. \\ Save the following lines to a new file "'' | + | Create a wrapper script which updates the game(s) automatically. \\ Create |
$ cat <<EOT > ~/ | $ cat <<EOT > ~/ | ||
#!/bin/sh | #!/bin/sh | ||
Line 116: | Line 142: | ||
app_update 90 validate | app_update 90 validate | ||
exit | exit | ||
- | </ | + | </ |
+ | crontab -e -u steam | ||
+ | </ | ||
55 3 * * * / | 55 3 * * * / | ||
</ | </ | ||
+ | |||
+ | Enjoy the game! | ||
+ | |||
+ | |||
+ | ====== Custom server maps for small servers ====== | ||
+ | |||
+ | If you enjoy close-combat games with your friends, some relatively small (less than 8 players) and enjoyable maps can be found here: http:// | ||