Half-Life Dedicated Server

From SME Server
Jump to: navigation, search

Introduction

The following How-to will help you setup your SME Server to be a Half-Life Dedicated Server for games like Half-Life, Counter-Strike: Source, etc... Information on this page is based on this thread in the SME Server forums.

Create new user

First off we are going to make a user called: hlds. It is better if we don't run our server as root, but rather we run it as a normal user, just so that there is less chances of a security breach.

To create a new user you will need to login as root to perform the following steps:

  1. Enter this from the command line:
    adduser hlds
    This will make a new user on our server with the username as hlds. You can choose a different username if you so wish, but making it hlds will clearly show what the user account is used for.
  2. Type the following:
    passwd hlds
    A prompt will appear where you can give the user hlds a password.
  3. Now logout of root and login as hlds.

Install hldsupdatetool.bin

  1. Enter this from the command line:
    wget http://storefront.steampowered.com/download/hldsupdatetool.bin
  2. Once it has finished downloading, issue the following command to make it an executable:
    chmod +x hldsupdatetool.bin
  3. Now logout of hlds and login as root.
  4. Navigate your way to the hlds user folder:
    cd /home/hlds
  5. We need to enable gunzip or something like that so we can run the hldsupdatetool. To do this, issue this command:
    ln -s /usr/bin/gunzip /usr/bin/uncompress
  6. Now logout of the root account and log back in as hlds.
  7. To run the hldsupdatetool, issue this command:
    ./hldsupdatetool.bin
  8. Say yes the the licence agreement. The hldsupdatetool will uncompress and extract some files. We now need to run the updater so it can update itself. To do this, type:
    ./steam
    The update shouldn't take to long depending on your internet connection.


Install Game

After hlds has updated you need to decide what game you want to install. For this how to I will just be installing a normal Half-Life server, but you are free to install a cstrike or czero etc... server if you so desire.

To update the server, issue the following command:
./steam -command update -game valve -dir /home/hlds
This will tell hlds to get all the files required for a normal Half-Life server. If you want to have a counterstrike server, all you need to do is change the -game valve to -game cstrike Or if you want condition zero: -game czero I don't know the commands for any other games, but they should be fairly easy to find using google.

Getting the game files may take some time, but after hlds has downloaded them, you'll be back at the prompt.

Start Server

Before we start our server, we need to issue the following command:
export LD_LIBRARY_PATH=/home/hlds:$LD_LIBRARY_PATH
Now we can start our server. Use the following command to start your server. If you are running a different game or don't like the command I'm using, feel free to change it to suit your needs.
./hlds_run -game valve +map crossfire +maxplayers 4 +port 27015

Hopefully your server has started. If it has, you can go on to customizing it!

Feedback?

Please post back in this thread if you have any feedback.