Create an user for your game server
It’s pretty simple. All you have to do is to run the following command in your terminal:
As you can see I added the user csserver. Remember that new users can only be added by the root account so you have to login to your server with the root account. You shouldn’t complete any of those other user details you are asked of… just hit enter.
After that you need to login with the new username your just created. It’s easy. Just enter:
Create folders, download and install the server
Next you navigate to your home folder using the cd command:
and then you create a directory in which to download steamdcmd and and one to install the server in (folder server will be where your server will be installed and the folder steamcmd will hold the installers):
mkdir server ; mkdir steamcmd ; cd steamcmd
Now it’s time to download the steamcmd Valve tool:
Untar the archive with:d
tar -xvzf steamcmd_linux.tar.gz
and run steamcmd.sh:
Now you wait until it downloads and installs the updates for SteamCMD and you will be able to see a command line starting with “Steam>”.
Once you see this you have to login to the steam server anonymously:
Once logged in let’s tell the installer where you want the folder to be installed:
Now it’s time to sit back and relax (or maybe smoke) until the installer (steamcmd) downloads all the server files. You download the server with:
app_update 90 validate
SteamCMD has a bug related to HLDS games. Make sure you run this command multiple times until you see progress 100.00 and Success! App ’90’ fully installed.
Nice. Now the server is downloaded and installed. Let’s get to the part where I had to search for almost 2 hours on google to get my server stable with metamod and dproto. These 2 plugins are necessary in order to run your server in hybrid mode (explained at the beginning of this post).
Let’s start with metamod. Metamod is a plugin interface for Half-Life modifications that is located between the Half-Life game engine and a Half-Life mod, providing the dynamic loading and unloading of DLL plugins to add or remove extra functions to or from the game server. Change to folder to /home/csserver/server/cstrike ( where /home/csserver/server holds the installed files with steamdcmd ).
Create the folder addons/metamod/dlls:
mkdir addons ; cd addons ; mkdir metamod ; cd metamod ; mkdir dlls ; cd dlls
I saw that my server crashed every hour or so using the metamod plugin. I searched and I saw that metamod-p plugin is also available and it’s better than metamod. The website for the metamod-p plugin: http://metamod-p.sourceforge.net/
Make sure than you are in the /home/csserver/server/cstrike/addons/metamod/dlls/ and download metamod-p-1.21p37-linux_i686.tar.gz or you can get it from me and untar it:
tar -zxvf metamod-p-1.21p37-linux_i686.tar.gz
Go up one level and create the file plugins.ini:
Go up again to the folder cstrike:
and edit liblist.gam ( I prefer pico so the command is as follows )
Go the the line with gamedll_linux “dlls/cs.so and change it to gamedll_linux “addons/metamod/dlls/metamod.so.
Save the file with this key combination: CTRL + X, then Y and ENTER.
dProto is a plugin for metamod that allows protocol 47 and 48 no-steam clients to join the server. dProto page at: http://cs.rin.ru/forum/viewtopic.php?t=55986
To install dProto you have to go back to your addons folder:
and create the folder dproto:
mkdir dproto ; cd dproto
Download dproto from the page above or from me: dproto_i386 and unzip it:
If you ls you should see that in your /home/csserver/server/cstrike/addons/dproto/ folder your have the file dproto_i386
Let’s put in the config for dproto in the cstrike folder:
These 2 commands will create the dproto.cfg file needed by dproto.
And the last thing to do in order to get your server to work is to tell metamod about dproto which is easily done by editing the plugins.ini file in /home/csserver/server/cstrike/addons/metamod.
Paste this in:
and save the file with CTRL + X, Y and Enter
Start the server
To start the server you need to launch hlds_run from the /home/csserver/server folder with some parameters:
./hlds_run -console -game cstrike -ip 188.8.131.52 -port 27015 +maxplayers 32 +map cs_assault
Remember to replace 184.108.40.206 with your own ip and if you’re behind a router open up the 27015 port and redirect it to your server.
You can also screen the server with:
screen -S csserver ./hlds_run -console -game cstrike -ip 220.127.116.11 -port 27015 +maxplayers 32 +map cs_assault
You exit the screen by pressing:
CTRL + A and then D
You can return to the screen with:
screen -r csserver
And everything should be working just fine. Run your Counter Strike 1.6 game, open up your console by pressing ` and type:
Replace 18.104.22.168 with your server’s ip of course.