Rcon (Remote Console) Tutorial


What is a Half-Life Server?


When you play Half-Life with other players via the Internet someone is "hosting" the game. The host collects all the player information, rotates the maps, keeps logs, and basically acts as the starting point for the game. When you join a server you are a client to that host. In order to control the host from the client, you need to have rcon (Remote Console).

Whatever type of server you run you should have some pretty beefy hardware and a really good internet connection. If you are considering hosting a server on your 56K dialup, you had better password it and just let a few friends in. Otherwise your log files will be filled with complaints about lag!

Basically there are three types of servers:

  1. HLDS (Half-Life Dedicated Server). This server program may be run on any system with a link to the internet. It is a DOS based program and may be run independently of the Half-Life game. You need not have Half-Life loaded to run this server type. This stand-alone server program is used by administrators who want to give their players the absolute best possible performance. The host should not join a game on the host computer while this server is running. If they did, the performance of both HLDS and the game would be severely degraded.

    When the HLDS.exe program is running it looks something like this:

    The blank line at the bottom of the screen is the input area. The top line in red is the "status" area.

  2. Half-Life In-game Server. This server is very much like HLDS except it is started from inside the Half-Life game. The setup is much simplified over the HLDS configuration but there is a performance hit to the players. I will post a screen shot of this server type running as soon as I can. The host may not join a game on their computer while this server is running.
  3. Half-Life Listen Server. This server is run underneath the Half-Life game. It is started very much like the Half-Life In-game Server but it does allow the host to play on the server with other players. It is by far the slowest server where performance is concerned. If you join a server and see a player with a ping of 20, he is probably on the host of that Listen Server.

I thought we were going to talk about rcon?


Okay, okay! Let's move on to rcon.

What is rcon exactly? Well, funny you should ask... rcon is short for Remote Console. In order to perform certain operations on a server you have to type commands at the console line. In the current version of Half_Life if a server has no rcon_password then rcon is completely disabled. So, if you do not set an rcon_password you will never be able to rcon your server!

In order to rcon the remote server, your rcon_password and the server's rcon_password must be the same. There is a way around this (you still have to know the server's rcon_password) but it is a little more complicated so let's not go there.

Every rcon command will start with the word rcon. This may seem logical and simple but I cannot count the times I have tried to kick someone off of my server and forgotten to put the word rcon at the front of the command -- D'oh!

All of the following examples assume that you are entering commands into the console of your client system; i.e. you are connected from your home machine to the server at your office.


Setting the rcon password


Let's set your rcon_password. At the console prompt enter:

rcon_password^booboo (Note: anytime you see a ^ in this tutorial it indicates a space.)

You will not have to enter this password again unless you disconnect from the server. This password must match the rcon password ser in the servers server.cfg file. If they do not match, you will not be able to use rcon. Be careful of punctuation! If the server's rcon_password is Booboo and you set your to booboo, rcon will not work and you will get the "bad rcon password" message.

You can save yourself a lot of typing by editing your config.cfg file and adding the line rcon_password booboo. Now when you join your server (or any server for that matter) your rcon_password will already be set. Now we can enter some rcon commands.


Users


Let's see who's on the server (yes, I know you could just hold down the TAB key!), at the console prompt enter:

rcon^users

You should get a display similar to the following:


Rcon Say


Now we have Blackhawk's userid! His userid is generated by the server when he enters (not joins!) the server. We also have his uniqueid which is his unique id from W.O.N. Now let's send him a message because the other players are complaining about his spamming behavior. At the console prompt enter:

rcon^say^Hey Blackhawk, stop spamming or you will be kicked!.

The reason we want to use rcon in front of the say command is because it will look like the message is coming from the console. If we just used "say ..." the message would be preceeded by our player name.


Kicking


Still spamming or team killing? Let's kick him because he is being a jerk! At the console prompt enter:

rcon^kick^Blackhawk

*ping* He's gone. Now we have seen the handles of some of the "bad sports" out there and typing them can cause all kinds of problems, let's try it a different way. At the console enter:

rcon^kick^#^6

*ping* Same result! We use the pound sign (#) after the kick command to let the kick command know we are going to use a userid instead of a name. This is just in case there is a player out there with a number for a name.


Banning


Now, he could rejoin the game if he chose to and we could continue to kick him but for a real problem child we would want to ban him. Let's go on and do that. At the console prompt enter:

rcon^banid^30^13989

Now we know that 13989 is [OGzr]Viaga's uniqueid, the 30 in the middle is the amount of time in minutes for which we want him banned. If we had used 0 (zero) he would be permanently banned from the server! Even after a reboot! This is a pretty serious step and it should only be done by the real server admin, but use your best judgment. There is a way to unban users but I am not going to cover that here.


Kicking while Banning!


Now let's say that we wanted to kick and ban this errant son all at the same time. At the console prompt enter:

rcon^banid^60^13989^kick

*ping* Kicked and banned for 60 minutes all in one fail swoop!


The Whole Enchilada


The whole process should look something like this:

*We see that jojo is killing his own teammates, spamming, cursing, being a jerk, etc...*

at the console:

rcon say Hey Jojo, please do not kill teammates!

*jojo continues to be a pest*

say Jojo, If you do not play right you will be kicked and banned for 60 minutes.

*jojo ignores our request or responds with some profanity*

rcon say Say bye bye Jojo

rcon^banid^60^12345^kick

Jojo is gone and will not be back for an hour.


Changelevel


Now let's say we have been playing all the fun maps in our killer rotation but some of the players decide it is time for something special or Canal Zone comes up and is greeted with "No, not this map!" As good administrators, we will want to change the map to keep all these superior players on our server, so at the console prompt enter:

rcon^changelevel^2fort

Notice that we do not enter the .bsp extention! Yes, there is a command called "map" that is used in the server's autoexec.cfg. The map copmmand can be used to load up a different map but the problem is that it will kick all the players from the server before it loads the map... Not very friendly. Stick with the changelevel command.

There is also a command called changelevel2 which is supposed to load a new map and leave all the players on the same teams. Almost everytime I have used this command it has kicked all the players and crashed the server. But feel free to give it a try; the syntax for changeleve2 is the same as changelevel.


Maps


After several hours (days!) of continuous play you decide that it is time to try a new map, something out of the ordinary, something NOT 2FORT! If you have carefully copied down the list of map names from the all the map directories then you should really get a life! We have a very nice rcon command to help you see what maps are located on the server. At the console prompt enter:

rcon^maps^*

You will get a display similar to the following:

...not very useful is it? We can only see the maps include in the TFC PAK file and a few from the Death-Match directory. Let's try a search string instead. At the console prompt enter:

rcon^maps^2

You will get a display similar to the following:

Now that's a little better. We can see all the maps that start with the number 2. As you can see you will need to look around a bit but if you know which map you are looking for, just type in the name or just the beginning of the name name... Simple as that. For those of you running Counter-Strike you can search by entering any of the following commands:

rcon^maps^cs_ To see Hostage Rescue maps

rcon^maps^de_ To see Bomb Defussion maps

rcon^maps^as_ To see Assassination maps

rcon^maps^es_ To see Escape maps

The wildcard * may not be used as part of the search string. Entering rcon^maps^*es_ would show all maps.


In Conclussion...


Now you know how to changelevel, kick, banid, set the rcon_password, and search for maps. I can't think of anything else you would want to do remotely so that ends today's lesson. Please beat some erasers before you go and don't forget your milk money.

For all the information on server commands go to Command Central!

Questions or comments? Send e-mail to Coder

---Back---