A Basic Guide to RCON
Rcon commands allow you to change server side settings and use commands that are normally forbidden.The following guide will teach you the basics of using rcon commands on a TF2 server.
Chapter 0: The console
Before you can do anything with rcon, you need to enable your console in TF2.
To do this, go to Options and then click Advanced and tick the box that says "enable developer console".
Note that it's Options -> Advanced, not Advanced Options - that's a different menu. Thanks Valve.
Once you've enabled the console, get it to pop up by pressing ` (the tilde key), which on most keyboards is to the left of 1 and above Tab.
Chapter 1: The rcon password
Before you can use any of the interesting rcon commands, you first need to show the server that you have rcon privileges. You do this by telling the server the rcon password. To do this, use the command:
rcon_password <password goes here>
If you try to enter rcon commands without putting in the password, the server will say "Bad rcon password" in the console and just ignore the command you sent.
You should only have to enter the password once per session - your rcon access will be preserved across things like map changes or a quick reconnect. If you completely quit TF2 or restart the server however you may have to re-enter the password.
Chapter 2: Using rcon commands
Once you've authenticated it's time to use some commands!
To use an rcon command you must precede the command with rcon. So for example if I wanted to turn birthday mode on, I would write
rcon tf_birthday 1
If I left out the rcon part beforehand, I would simply get a message in the console saying this can only be done by server operators. So always put rcon before the cvar you want to use.
There are literally hundreds of cvars in TF2, but most of them are irrelevant for the purposes of running a TF2Center lobby, so this guide will focus on the ones you will need.
To run a server config, you would use the exec command, and you will also need to know the name of the config file. So for example to run the ETF2L 6s config file etf2l_6v6.cfg, you would write
rcon exec etf2l_6v6
To change the map, you would use the changelevel command. You will also need to know the exact map name - for example if you want to change to snakewater you would need to write
rcon changelevel cp_snakewater_final1
To change the map time limit, you would use the mp_timelimit cvar. Sometimes the config will set the wrong time limit or no time limit at all (i.e. mp_timelimit 0). So to correct the limit to 30 minutes you would write
rcon mp_timelimit 30
To kick a player, you will first need to know their userID. You can find the userID of everyone currently connected to the server with the status command. So you will first need to write
rcon status
And once you have identified the person you want to kick, write
rcon kickid <their userID here>
The status command also tells you players' Steam IDs which can be helpful for later reporting.
Note that there is a separate kick command which lets you kick people by their ingame name, but it is easy to make a mistake and kick the wrong person this way. There is also the possibility that they will change their ingame name to someone else's for this exact reason, so it is generally better to use the kickid command instead to be sure you are kicking the right person.
Chapter 3: General console tips and tricks
To scroll through the last commands you have written to the console, use the up and down arrow keys. This is particularly handy if you want to re-enter a command - just scroll to it and hit enter.
Or if you just wrote a long command but made a mistake (maybe you put _final instead of _final1 in a map name - we've all done it!) just scroll to the command, make your changes, and hit enter without having to retype the whole thing.
If you can't remember the exact name of a cvar, try the find command. It will return all the cvars containing the string you enter, along with a brief description of the cvar. So if I know the cvar for birthday mode has "birthday" in it but I can't remember what it is, I might write
find birthday
If you can't remember the exact name of a map, try just writing "map " (with the space). The console should start to suggest entries underneath the console dialogue box to autofill the rest of what you're looking for, and will narrow the suggestions down the more you type, so you can easily see the correct mapname.
Note that this will only show you maps that you already have installed on your computer, so if it's a custom map that you don't have this might not work for you.
This concludes the Basic Guide to RCON. I hope this was helpful, please feel free to leave any feedback below.