Wednesday, April 9, 2014

Counter Strike 1.6 SteamCMD Non-Steam Server Setup Guide [Hybrid Server]

    [Image: ODpCrVQ.png] 

In the following tutorial you will learn how to install a hybrid Counter-Strike 1.6 server on a Linux powered server at your own. A hybrid Counter-Strike 1.6 server is a Counter-Strike 1.6 game server that allows Steam clients (legit Steam accounts) and non Steam clients (non Steam game clients) as well as owners of old game clients with the game protocol version 47 to enter your server.

This hybrid mode is achieved by a metamod plugin called "Dproto" by Crock from a Russian Counter-Strike community. The guide is written within the new standards of SteamCMD by Valve as HLDSUpdateTool has become outdated. However SteamCMD is not as final as HLDSUpdateTool was so you may experience certain issues.

In cases of issues or if you need help feel free to ask for help here. 





1. Create a new Linux user for your gameserver

It is highly not recommended to run a gameserver from your root account or a Linux user account that already runs other applications.

Therefor you will create a totally new Linux user account which will be used to run your Counter-Strike 1.6 hybrid server.

Use the following command to create a new Linux user account:
adduser <username>
(New Linux user accounts can only be created by root)

Replace "<username>" with the username you'd like to use for the gameserver. You will be asked to fill in the password twice and some other information. Do this steps to create the user. You don't have to fill out things like Full name, Room Number and so on. To leave them empty just hit enter. When you are asked if the information is correct press Y and then hit your ENTER key.

Screenshot
[Image: 5hDvzSF.png]

After you've hit your ENTER key the user creation process will finish if all information was entered correct.

Login as the new user with the su command:
su <username>

Replace "<username>" with the username of the user you created. After you typed the command hit your ENTER key to login. You can also logout from your account by closing your SSH session and opening a new session where you login with the new user.

Screenshot
[Image: iJO0t1a.png]

After you've logged into the user with su you still will be located at "/root" where normal users cannot operate.

Use the cd command to go to your own home directory:
cd

Just type in cd and hit your ENTER key and you will be in your home directory. If you have opened a new SSH session as the new user you don't have to do this because you are already in your home directory.


2. Download and extract SteamCMD

Now you have to download the SteamCMD client to your home directory and extract it to use it for the installation of the actual gameserver.

Make a new folder for it called "steamcmd" with the mkdir command:
mkdir steamcmd

Screenshot
[Image: mpDBAHV.png]

Just type in the command and hit ENTER to create the folder. After that change directory to that folder with the cd command.

Change directory to steamcmd:
cd steamcmd/

Just type in the command, hit ENTER and you are already in the folder.

Screenshot
[Image: 5UC2Rrt.png]

You are now in the folder for Valve's tool SteamCMD. Time to download the tool from Valve's server and extract it.

Download SteamCMD:
Code:
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz

Type in the command and hit ENTER and watch it downloading.

Screenshot
[Image: o23xfuL.png]

Extract the downloaded archive with the tar command:
tar -xvzf steamcmd_linux.tar.gz

Enter the command and hit ENTER. A progress will be shown and you can watch all files being extracted.

Screenshot
[Image: WQG4163.png]

You have successfully downloaded and extracted the SteamCMD tool.


3. Installation of the Counter-Strike 1.6 gameserver files

Time to download the gameserver files for Counter-Strike 1.6 files to your server.

Start steamcmd:
./steamcmd.sh

Just type in this command and hit ENTER. You will see the tool starting and updating itself.

Screenshot
[Image: OL1VIzH.png]

Wait until it has downloaded and installed the updates for SteamCMD and you will be able to see a command line starting with "Steam>".

Screenshot
[Image: I49tPb8.png]

Now login as anonymous in the SteamCMD command line.

Login as anonymous:
login anonymous

Enter the command from above and hit ENTER. If the login was successful you will get a message like this one: "Connecting anonymously to Steam Public...Success.".

Screenshot
[Image: ZXYpDga.png]

Time to set the directory where you want the gameserver files to be installed. I recommend them to be installed in a folder called like the game in your home directory.

Set installation path:
force_install_dir /home/username/cs

Replace "username" in "/home/username/cs" with the name of the user you are logged in and then hit ENTER to set the path.

Screenshot
[Image: 0nLlqY9.png]

Now let's download the files with the app_update command.

Download the server files:
app_update 90 validate

Just type in this command hit ENTER. WARNING: SteamCMD has a bug related to HLDS games. You are required to run command to download the files multiple times to download all files!

Screenshot (1st attempt)
[Image: v3LeA87.png]

You are not done because the bug is doing it's job right now. Run the command again.

Screenshot (2nd attempt)
[Image: kLJcTmL.png]

If you think you are done you're wrong. Run the command again to try to defeat the bug.

Screenshot (3rd attempt)
[Image: SMrGbeK.png]

Now SteamCMD has started downloading the files and we have defeated the bug. Wait until it has finished the download process.

Screenshot
[Image: 3Jdo44r.png]

Run the command a last time to validate all files to avoid broken files or incomplete downloads.

Screenshot (successful validation)
[Image: f7hbYbD.png]

Everything is good and you've downloaded and validated the gameserver files. Quit SteamCMD with the command "quit".

Quit SteamCMD:
quit

Screenshot
[Image: fHZyHOg.png]

If SteamCMD was successfully closed you will see a half broken SteamCMD command line entry and your real command line as in the screenshot above. This is a sign of success for the quition process. 


4. Install metamod

We have the plain gameserver files that only allow legit Steam clients to access your gameserver but not non Steam clients or clients with older game protocol versions.

We need metamod and Dproto to achieve the hybrid mode.

Change directory to the gameserver files:
cd ../

cd cs

First type in "cd ../" and then "cd cs" to change directory to the gameserver files.

Screenshot
[Image: mZOqdfu.png]

Once you are in the folder change directory again to the "cstrike" folder.

Change directory to cstrike:
cd cstrike/

Enter the command in your command line, hit ENTER and you're there already.

Screenshot
[Image: GQlnWNj.png]

Now create a folder called "addons" with mkdir which will be used for the plugins metamod and dproto.

Create addons folder:
mkdir addons

Change directory to addons:
cd addons/

Create metamod folder:
mkdir metamod

Change directory to metamod:
cd metamod/

Create folder dlls:
mkdir dlls

Change directory to dlls:
cd dlls/

Download metamod:
Code:
wget http://apps.singul4rity.com/metamod-1.20-linux.tar.gz

Extract metamod:
tar -xvzf metamod-1.20-linux.tar.gz

Screenshot
[Image: GHyy6Pf.png]

Go up one level and create a file called "plugins.ini" that we'll need to load up Dproto through metamod.

Go up one level:
cd ../

Create plugins.ini:
touch plugins.ini

Screenshot
[Image: xQQsiMD.png]

Go back to the cstrike folder with the cd command.

Go back to cstrike:
cd /home/username/cs/cstrike

Replace "username" with the username of the user where you have the gameserver files installed on.

Screenshot
[Image: mKrhX9H.png]

Open the file "liblist.gam" with a text editor like nano or vi. I recommend nano for newbies because vi will only confuse you and you will get very angry with it (if you don't have it install it as root before doing this step through a second SSH session).

Open liblist.gam with nano:
nano liblist.gam

Just type in this command and hit ENTER. The editor will load up the file and you will see the content.

Screenshot
[Image: CGcn3S6.png]

Navigate through the editor with your up, down, right and left keys. Go to the line with "gamedll_linux "dlls/cs.so" and change it to "gamedll_linux "addons/metamod/dlls/metamod_i386.so".

Screenshot
[Image: Duk7DGf.png]

Save the file with the following key combination: CTRL + X, then Y and ENTER.

Screenshot
[Image: NfyHw1l.png]

Now metamod is installed successfully and the gameserver will use metamod's .so files to launch with plugin support. 


5. Install Dproto

Now it's time to install Dproto to enable hybrid mode.

Change directory to addons:
cd addons/

Create dproto folder:
mkdir dproto

Change directory to dproto:
cd dproto/

Download dproto dlls:
Code:
wget http://apps.singul4rity.com/dproto_i386.so

Screenshot
[Image: BlVQL9k.png]

Go back to the cstrike and download the dproto configuration file.

Go back to cstrike:
cd /home/username/cs/cstrike

Replace "username" with the username of the user where you have the gameserver files installed on.

Download dproto.cfg:
wget http://apps.singul4rity.com/dproto.cfg

Screenshot
[Image: dRivzjW.png]

Now you have to enable Dproto as a metamod plugin.

Change directory to addons:
cd addons/

Change directory to metamod:
cd metamod/

Screenshot
[Image: 9xcepqw.png]

To enable it as a plugin open plugins.ini with nano.

Open plugins.ini with nano:
nano plugins.ini

Add the following to the file "linux addons/dproto/dproto_i386.so".

Screenshot
[Image: Ny6Cu6x.png]

Save the file with the following key combination: CTRL + X, then Y and ENTER.

Screenshot
[Image: 8UPlUUI.png]

Now we've activated Dproto in metamod and enabled the hybrid mode.


6. Start the server

Time to start the server. First go back to the folder with all gameserver files and then issue the startup command.

Go back to the gameserver files:
cd /home/username/cs

Replace "username" with the username of the user where the gameserver files are installed.

Screenshot
[Image: liEPmCt.png]

Now let's start the gameserver.

Start the gameserver:
./hlds_run -console -game cstrike -ip <ipofyourserver> -port 27015 +maxplayers 32 +map de_dust2

Replace "<ipofyourserver>" with the IP address of your VPS and then hit ENTER to start the server.

Screenshot
[Image: FlOx8J7.png]

It is likely that you will get a error like:
Code:
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
FATAL ERROR (shutting down): Unable to initialize Steam.


If this happens press CTRL + X to exit the crashed server and to continue the guide to fix the error. Otherwise you have started the server success and the last you see is " VAC secure mode is activated.".

The fix: Run the server startup command again and the server will launch properly.



You're done. This is everything. You have started the server and it is running. Now you can connect and play. It will close when you leave the SSH session so I recommend to start it up in a screen or tmux session.

7 comments:

  1. logging in with anonymous didnt work for me (files were not downloaded, the bug mentioned above). But logging in with a real steam acc did!

    Also try:
    app_update 90 -beta beta validate

    ReplyDelete
  2. this worked but cant use 47 protocol clients.... why?

    Thank you all

    ReplyDelete
  3. sever worked but is autobaning all users after some time. reason "you where banned from the server." And i dont know how to fix it, i kill the proceess i restart the server, and ban is removed, but after playing again some time, all players get banned again. Help me

    ReplyDelete
  4. i cannot connect from non steam clients. why is this? any idea?

    ReplyDelete
  5. Released Romania îți pune la dispoziție CS.RELEASED.RO # CS 1.6 PUBLIC SERVER

    De ce să alegi cs.released.ro? Ai toate detaliile aici: https://forum.released.ro/topic/19/descriere-server-puncte-forte

    Împreună la un alt nivel.
    www.released.ro

    ReplyDelete
  6. how can i set to autorun on boot ? or of crash?

    ReplyDelete
  7. Steam Validation REJECTED on non-steam profiles :/

    Willing to help for a small financial support?

    ReplyDelete