Team Fortress 2

Team Fortress 2

53 vurderinger
Team Fortress 2 server management in competitive games through RCON
Af supra #poLANd.tf og 1 partnere
In this tutorial I am going to show you how to configure the Team Fortress 2 server for competitive games, among others to set up a proper config for specified league/gamemode, how to set up a specified map, custom whitelist and so on.
The examples shown in this tutorial are based on serveme.tf server and dedicated one of my own.
   
Pris
Føj til foretrukne
Gjort til foretrukken
Fjern som foretrukken
What RCON is and what it does let you do?
Remote CONtrol is a remote console in Team Fortress 2 which allows administrators to manage the server by typing commands. Administrators, by using RCON, can change most of the variables which makes them able to control the server in the way they want (for example to set up the server for competitive games).

To get better understanding of how to use commands, I am going to explain what the TF2 variable is. The variable is a defined option in-game both on client and server side. For instance, by using variables we can define whenever we want to run TF2 client in full screen mode or in windowed one. The list of all TF2 console commands and variables is available right here.
How to use RCON?
To start using remote commands to the server it's essential to execute command rcon_password remote_control_password and, just for good measure, to execute rcon_address server_address:port.
If we are on the controlled server already, we don't have to use rcon_address, but if we do so, we don't have to be on the server to execute commands. For instance, if you don't remember the password, you can check what it is.












When you have your RCON password defined, to execute rcon commands you have to follow the syntax:
rcon command
In case of using serveme.tf servers commands can be also executed from chat:
!rcon command
For example executing rcon changelevel pl_badwater in the console window will change the current map on the server to Badwater Basin (pl_badwater).
When executing complex commands it's crucial to use quotes while issuing commands with arguments that have spaces in their values.
For instance, the command that starts voting on the server, sm_vote has the following syntax:
sm_vote <vote_title> <option 1> <option 2> [option 3] etc.
This is one of the most common mistakes while executing this kind of commands:
rcon sm_vote next map? badwater product upward warmtic
will give us:







The desired solution is:
rcon sm_vote "next map?" badwater product upward warmtic
or
rcon sm_vote "next map?" "badwater" "product" "upward" "warmtic"
This solution looks like that:







As you can see - using quotes is optional. From my experience I use quotes only if it is needed because of my laziness, but in general using it everywhere is a good practice.
Configuration files (configs) - creating, loading
In the competitive mode server must be configured according to league restrictions, so basically speaking you have to load a config alongside with a respective whitelist, so it will work as one ready setup. Configurations are used to prevent people setting up the server command by command. When the server operator want to execute specified setup, he can just use a prepared configuration setup saved into a file and when needed - execute it. That can be done through RCON or through direct server console.
I'll focus on RCON usage here.

An important thing you have to know is configuration is read line-by-line which means the later the config is read, the later value is used in the config which means if for example config_a sets up mp_winlimit 3, config_b sets mp_winlimit 0 and I execute these files in order config_a, config_b - value from the latest config used will be set in game (which is mp_timelimit 0).
Usually configs are written with a rule - one variable = one line, but you can combine two commands into one if you divide them by a semicolon (;), for instance:
connect supra.tf; password dupa69

To load config you need to execute a command with the following syntax:
rcon exec etf2l_9v9_koth
If the server contains a file called etf2l_9v9_koth.cfg in the directory <server_root_folder>/tf/cfg/, then the configuration will be loaded.

ATTENTION: the command exec can be either used as a part of the config which means configs can load another configs. It allows you to reduce the amount of lines needed to create all configuration options. Almost all current leagues are using that trick.

If you have your own dedicated server, all you need to do start being able to load configs is placing desired configuration files into <server_root_folder>\tf\cfg\ catalog and that's it - you'll be ready to set up the server.

The servers are capable to used predefined setups for desired maps - to make it, you need to create file called <map_name>.cfg, for example pl_badwater.cfg and you can put anything you want to set up for this map, for example if you want to load ETF2L 9v9 Stopwatch config which is proper for this map in this league, all you need to write inside this config is
exec etf2l_9v9_stopwatch
.
When changing map on the server, it loads configuration files with the following order:
1) <server_root_folder>/tf/cfg/server.cfg,
2) <server_root_folder>/tf/cfg/<current_map_name>.cfg
3) <server_root_folder>/configs_loaded_by_server_operator.cfg
It's a good measure to reload configs after every single map change to make sure all settings are correct (I got one map defaulted for messing up the server configuration, so yeah - IT'S IMPORTANT).


Which config should be loaded and when?
It depends which gamemode and in which league we play:

European Team Fortress 2 League (ETF2L):
  • 6v6:
    • etf2l_6v6_5cp.cfg – ETF2L rules for 6v6 5CP maps, such as cp_prolands_b5
    • etf2l_6v6_koth.cfg – ETF2L rules for 6v6 KOTH maps, such as koth_product_rc9
    • etf2l_6v6_ctf.cfg – ETF2L rules for 6v6 CTF maps, such as ctf_turbine
    • etf2l_6v6_stopwatch.cfg – ETF2L rules for 6v6 Stopwatch maps, such as cp_gravelpit
  • Highlander:
    • etf2l_9v9_5cp.cfg – ETF2L rules for Highlander 5CP maps, such as cp_process_final
    • etf2l_9v9_ctf.cfg – ETF2L rules for Highlander CTF maps, such as ctf_haunt
    • etf2l_9v9_koth.cfg – ETF2L rules for Highlander KOTH maps, such as koth_lakeside
    • etf2l_9v9_stopwatch.cfg – ETF2L rules for Highlander Stopwatch maps, such as pl_badwater and cp_steel
  • Other:
    • etf2l_ultiduo.cfg – ETF2L rules for Ultiduo.
    • etf2l_bball.cfg – ETF2L rules for BBall.
    • etf2l_golden_cap.cfg – ETF2L rules for a golden cap on 5cp maps.

United Gaming Clans (UGC):
  • 6v6:
    • ugc_6v_standard.cfg – UGC rules for 6v6 5CP maps, such as cp_prolands_b5
    • ugc_6v_standard_overtime.cfg – turns on overtime in the Control Points mode
    • ugc_6v_golden.cfg – config for executing the Golden Cap mode on UGC 6v6 maps
    • ugc_6v_koth.cfg – UGC rules for 6v6 KOTH maps, such as koth_product_rc9
    • ugc_6v_koth_overtime.cfg – turns on the overtime in KOTH mode
    • ugc_6v_ctf.cfg – UGC rules for 6v6 CTF maps, such as ctf_turbine
    • ugc_6v_ctf_overtime.cfg – turns on the overtime in CTF mode
    • ugc_6v_stopwatch.cfg – UGC rules for 6v6 Stopwatch maps, such as cp_gravelpit
  • Highlander:
    • ugc_HL_standard.cfg – UGC rules for Highlander 5CP maps, such as cp_process_final
    • ugc_HL_koth.cfg – – UGC rules for HL KOTH maps, such as koth_product_rc9
    • ugc_HL_stopwatch.cfg – UGC rules for Highlander Stopwatch maps, such as pl_badwater
  • 4v4:
    • ugc_4v_standard.cfg – UGC rules for Highlander 4v4 maps, such as cp_process_final
    • ugc_4v_koth.cfg – – UGC rules for 4v4 KOTH maps, such as koth_product_rc9
    • ugc_4v_stopwatch.cfg – UGC rules for 4v4 Stopwatch maps, such as pl_badwater
  • Other:
    • ugc_off.cfg – ends the match immediately

Recharge Gaming League (RGL):
  • RGL_5cp – RGL rules for 5CP maps, such as cp_process_final
  • RGL_koth.cfg – RGL rules for KOTH maps, such as koth_product_rc9
  • RGL_stopwatch.cfg – RGL rules for Stopwatch maps, such as pl_badwater
  • RGL_off.cfg – ends up the match immediately.
Renting servers from serveme.tf
Not everyone can afford to rent a dedicated server or is knowledgeable enough to set a server up from scratch. Thanks to serveme.tf, you can rent their servers for competitive games for free.
To rent a server you need to:
  • go to the https://serveme.tf webpage,
  • log into your Steam account,
  • choose an option Let's play! or I'm feeling lucky (the first one lets you specify the reservation options, the seconds immediately rents a server for an hour with your previous setup or default setting if you use servme.tf for the first time):









  • define reservation options:
























































    • Starts at - reservation start time
    • Ends at - reservation end time
    • Server - we choose the server here (Premium users have larger amount of servers to use)
    • Ping - shows up our current latency between you and the server
    • Password - access password to the server
    • Rcon - RCON password
    • First map - that map will be executed when the reservation starts
    • STV password - SourceTV password (by default it's tv)
    • Relay password - SourceTV relay server password (by default it's tv, relay server are used to extend total amount of available observator slots)
    • demos.tf - turns on a plugin used to save demos on specified website (enabling an option below allows you to use this option without having Premium account)
    • Server config - sets a desired config which will be executed after the reservation starts
    • Item whitelist - sets a desired whitelist; while option Default doesn't set anything, League forces a whitelist for specified in League whitelist, Whitelist.tf allows you to set whitelist per its ID or custom preset name.
    • Auto end - ends up the reservation automatically after all players leave the server
When everything is set up as desired, all you need to do is to click Save and then our reservation is created. The outcome look like this:












If you'd close the browser by chance, you can go back to all your reservations by the option shown on the screenshot:




What are the perks on serveme.tf:
  • more servers to choose from (maybe you don't have to care which server you use, but the option to use any server is a plus especially when you want to rent a server in days when usually official matches/scrims are made)
  • longer reservation time (free users have 2 hours, Premium have 5)
  • longer idle time allowed (free users have 30 minutes, Premium have an hour)
  • the ability to upload maps
  • easier extension of reservations (!extend extends server reservation 20 minutes for free, for an hour for Premium)
  • ability to reserve more than 1 server simultaneously
  • ability to make reservations more than 3 hours in the future
  • no ads (when you use uBlock you don't have it either, but by buying premium or unlocking ads you support the project)
Generally speaking I recommend this service.
Using whitelist according to whitelist.tf
This chapter may be useful in case of playing in the RGL league or organising tournaments.

https://whitelist.tf is a website that lets you inspect allowed/banned items for desired league/gamemode in a clear way (inspecting a text file containing thousands of lines can be a bad trip, the example is based on ETF2L whitelist for Highlander mode):


Here[whitelist.tf] you can see how a ready preset looks like for mentioned whitelist.
If you want to add or delete something from the whitelist - just click it on the site. Green color means the item is allowed, whilst the red one means its banned. When you're fine with what you whitelisted and blacklisted, just click the button:



And everything should be done. Our new custom whitelist is ready to use. There[whitelist.tf] you can find whitelist which I made for LANsilesia (MGE tournament to be precise).
Whitelists can be identified by ID number or its custom preset:


Head over to Useful commands if you want to find more information on how to use these whitelists on the server.
Useful commands
Of course you have to write rcon word before almost every single command below:

  • mp_tournament 1 - turns on the Tournament mode
  • mp_tournament_restart - restarts the Tournament Mode on the current level
  • mp_timelimit 30 - defines map timelimit in minutes to 30 (value 0 means no time limit)
  • mp_winlimit 3 - set win limit to 3 points (value 0 means there's no win limit)
  • mp_windifference 5 - defines maximum difference between amount of rounds won by teams to end the game to 5, so the game ends in case of score 5:0, 6:1, 7:2 etc.
  • mp_switchteams - swaps whole teams with each other (BLU team becomes RED, RED team becomes BLU), useful for Stopwatch maps
  • changelevel pl_badwater - changes the current map to pl_badwater
  • sv_password plmixes.tf - changes the server's access password to plmixes.tf (after the map change it will be rolled back to the value defined by the config)
  • exec etf2l_9v9_koth - loads config file called etf2l_9v9_koth.cfg
  • kickid 5 - //kicks a player with userid number 5 from the server (IDs can be checked by executing the status command in the console),












  • sm_kick @red - kicks the whole RED team from the server
  • sm_kick @blue - kicks the whole BLU team from the server
  • rcon sm_vote "which map" badwater product upward warmtic - turns on the vote; the results will be shown in the chat
  • rcon sm_votemap pl_badwater koth_product_rc9 pl_upward koth_warmtic_b6 - turns on the vote which results in a map change
  • sm_csay "LAST TO SPEC" shows up centered bold text LAST TO SPEC









  • tv_delay 0 - changes SourceTV broadcasting delay for 0 seconds, useful if you want to change map immediately and you don't want to wait for STV and you don't want to type the next command*]
  • tv_delaymapchange_protect 0 - disables map change protection while SourceTV is turned on (that variable prevents from cutting the preview of the last moments in game before map change
  • sv_cheats 1 - turns on "cheats"
  • mp_tournament_readymode 1 - turns on Ready Mode (for instance it is used on pug.champ.gg), turns on being ready per user, not per team
  • mp_tournament_readymode_countdown 10 - sets the countdown time before game starts after everyone readies up to 10 seconds
  • mp_tournament_readymode_min 2 - sets the minimum amount of players connected to the server to allow players setting their ready state to 2 (default value is 2)
  • mp_tournament_readymode_team_size 9 - defines minimum amount of players per team needed to start the game, of course value 9 is for Highlander mode
  • sm_cf etf2l - sets all fixes used in the ETF2L competitive games by a plugin tf2-comp-fixes[github.com], instead of setting ETF2L preset you can also set "ozf" for OZFortress and "rgl" for RGL



    TFTrue:
  • tftrue_freezecam 0 - turns on the freeze cam - dead players cannot see HP amount of the killer and it makes respawn time faster (useful for BBall gamemode)
  • tftrue_whitelist 2 - an alternative option to set up a whitelist, value 1 sets up ETF2L 6v6 whitelist, 2 is for ETF2L 9v9 one
  • tftrue_whitelist_id 9429 - loads the whitelist with ID number 9429,
  • tftrue_whitelist_id etf2l_9v9_s17 - loads a whitelist with custom preset etf2l_9v9_s17,
  • tftrue_restorestats 1 - turning on this option makes players' statistics restore automatically after reconnecting to the server during the same match
  • tftrue_logs_includebuffs 1 - turns on saving information about player buffs which are generated by logs.tf
  • tftrue_logs_accuracy 1 - turns on more accurate logs (for example they contain weapon accuracy); by default this option is disabled as it is more demanding in terms of computing resources;
To check current TFTrue settings, type !tftrue on chat:










Useful commands from client side which require sv_cheats 1 (they do not require rcon prefix):
  • noclip - allows player to move through walls and ignore gravity
  • hurtme 100 - deals 100 damage to the user, using negative value adds UP HP points
  • impulse 101 - replenishes the user's ammo and HP to maximum (HP is refilled only if player's HP is below maximum)
  • addcond 57 - gives infinite ÜberCharge effect to the user
  • addcond 3 - gives infinite Kritzkrieg effect for user
  • ent_remove - deletes currently aimed element on map (for example it can delete closed gates on pl_upward while in Tournament pre-game mode)






status - shows up a lot of useful information about the server where it is executed (for example the real amount of players, their userid's, steamid's etc.), if we execute rcon status, it will show up remote server status (it doesn't require user to be on the server)
My personal notes
A few things which most of the players don't understand for some reason:
If a service has a default port and we want to connect to that service - we don't have to define it.
Example:
My server (supra.tf) listen connections on port TCP 27015 which is default port used for SRCDS server (it is for games based on Source engine, so for Team Fortress 2 either).
It means that command will work:
connect supra.tf:27015
but this one will work either:
connect supra.tf
Because supra.tf domain is assigned to IP 194.13.80.222:








these commands will work either:
connect 194.13.80.222
connect 194.13.80.222:27015
SRCDS servers don't support IPv6 protocol itself, but SourceMod does it :).

Another example:
While connecting to the website facebook.com using HTTP protocol which uses TCP as default port we don't have to defined in the browser (like facebook.com:80), because the browser "knows what's going on" and will define it for us. Well, being redirected to the TCP 443 port due to Facebook using HSTS headers on their website is for another story ;)

Can you gimme the connect to stv?
If you're reading it now, it's highly likely you've already asked me for that. Apparently all serveme.tf, melkor.tf and my own supra.tf use SourceTV and they work on port +5 bigger than real game server and it use password tv. That configuration is kind of unwritten standard of SRCDS server configuration used by most of administrators.
Example:
If the server connect is:
connect supra.tf; password dupa69
then we can see I use default SRCDS port - 27015. it means the STV connect is:
connect supra.tf:27020; password tv

It looks very similiar to serveme.tf servers:
connect wilhelm.fakkelbrigade.eu:27125; password ra_no_yokushinryu
connect wilhelm.fakkelbrigade.eu:27130; password tv

Additionally by executing status we are able to check by themselves on which port SourceTV listen the connections and what delay amount is used on SourceTV instances:












Additionally I recommend adding these aliases to autoexec.cfg or custom.cfg if you use mastercomfig to not type that much text to the console:
rcon_password szosteczki rcon_address 54.38.187.170:27015 //trying to use wrong rcon on my server will ban you alias "tv" "rcon tv_delaymapchange_protect 0" alias "mixvote" "rcon sm_votemap "cp_prolands_b6" "koth_product_rc9" "cp_snakewater_final1" "cp_gullywash_final1" "cp_sunshine"" alias "reckoner" "rcon changelevel cp_reckoner_rc2" alias "badlands" "rcon changelevel cp_badlands" alias "prolands" "rcon changelevel cp_prolands_b6" alias "process" "rcon changelevel cp_process_final" alias "snakewater" "rcon changelevel cp_snakewater_final1" alias "gullywash" "rcon changelevel cp_gullywash_final1" alias "granary" "rcon changelevel cp_granary_pro_b8" alias "product" "rcon changelevel koth_product_rc9" alias "metalworks" "rcon changelevel cp_metalworks" alias "sunshine" "rcon changelevel cp_sunshine" alias "badwater" "rcon changelevel pl_badwater" alias "badwaterpro" "rcon changelevel pl_badwater_pro_v12" alias "upward" "rcon changelevel pl_upward" alias "barnblitz" "rcon changelevel pl_barnblitz_pro6" alias "steel" "rcon changelevel cp_steel" alias "borneo" "rcon changelevel pl_borneo"

Big thanks for: MuodyM and T.J for finding typos in the polish version of this guide, mały for translation review here and Houston for mentioning the Ready Mode.
4 kommentarer
czigányverő anyabaszó 17. juli 2021 kl. 9:22 
n1 thanks
Flynn 10. jan. 2021 kl. 18:16 
Git good
SkiPidar 10. dec. 2019 kl. 19:51 
Nice:cozytf2mug:
Tajto 21. mar. 2019 kl. 1:59 
Thanks :lunar2019piginablanket: