Difference between revisions of "Dedicated server configuration"

From Team Fortress Wiki
Jump to: navigation, search
(Server Settings)
m (Server Settings)
 
(69 intermediate revisions by 30 users not shown)
Line 1: Line 1:
 
==Installation==
 
==Installation==
 
=== Windows-based Server Installation ===
 
=== Windows-based Server Installation ===
This short tutorial will guide you on how to create a Dedicated Server for Team Fortress 2 on a Windows-based computer. One of the first and most useful tools that can be used for doing this is the Half-Life Dedicated Server Update Tool (or HldsUpdateTool). The HldsUpdateTool is an application that will completely install the latest version of the server content to your computer. If it is already installed when running HldsUpdateTool, the tool will update the existing Dedicated Server installation to the latest released version.
+
For a step-by-step guide on setting up a basic Team Fortress 2 Windows Dedicated Server, see the [[Windows dedicated server]] page.
  
You can download the HldsUpdateTool from: http://www.steampowered.com/download/hldsupdatetool.exe
+
This short tutorial will guide you on how to create a Dedicated Server for Team Fortress 2 on a Windows-based computer. The current tool used for doing this is the Steam Console Client Tool (or Steamcmd). Steamcmd is an application that will completely install the latest version of the server content to your computer. If it is already installed when running Steamcmd, the tool will update the existing Dedicated Server installation to the latest released version.
  
Once you have downloaded this, run the tool from a command shell and a GUI installer will pop-up and walk you through the initial installation. To save time and bandwidth when downloading files, it is wise to install the HldsUpdateTool into the root folder of an existing Half-Life Dedicated Server installation.
+
You can install TF2-server by downloading the Steamcmd from: http://media.steampowered.com/installer/steamcmd.zip
  
For more detailed installation instructions visit: http://forums.srcds.com/viewtopic/5439
+
Once you have downloaded this, run the tool from a command shell and a text windowed installer will automatically update/install your server. To save time and bandwidth when downloading files, it is wise to install the Steamcmd into the root folder of an existing [[Half-Life]] Dedicated Server installation.
 +
 
 +
An example command line option:
 +
 
 +
<kbd>steamcmd +login anonymous +force_install_dir C:\tf2_server +app_update 232250 validate +quit</kbd>
 +
 
 +
You may save this command line to a text file, rename it with the .bat extension which will convert it to a batch file.  This batch file can be run any time your server needs an update.
 +
 
 +
For more detailed installation instructions visit: {{vdc|SteamCMD}}
  
 
== MOTD ==
 
== MOTD ==
The MOTD is the "Message Of The Day". This is the message which appears upon successfully connecting to your server. A MOTD can be a simple message, or a complex website page. To modify the message, navigate to your orangebox/tf folder and edit the text in the files named motd.txt and motd_text.txt (the second file is used for players that have chosen to disable HTML MOTD files in their game).  
+
The MOTD ("<u>M</u>essage <u>O</u>f <u>T</u>he <u>D</u>ay") is the message which appears upon successfully connecting to your server. A MOTD can be a simple message, or a complex website page. To modify the message, navigate to your orangebox/tf folder and edit the text in the files named <code>motd_default.txt</code> and <code>motd_text_default.txt</code>.
  
Both files have limitations, one of which is that file may not be greater than 1k in size (approximately 1536 characters). The motd_text.txt, however, will render any HTML as it would appear in any basic internet browser.
+
The difference between the two files, is that if the <code>motd_default.txt</code> file contains any web programming language of client side ([[w:HTML|HTML]], [[w:CSS|CSS]], [[w:JavaScript|JavaScript]]), whether writing directly to the file or displaying the content by providing a URL to the file, but the user has decided to disable HTML MOTDs - the content of <code>motd_text_default.txt</code> file will be used instead.
  
A possible workaround for the files limitations (i.e., the size limit) is to place a link to a hosted .html file on the web. For example placing this as your motd.txt: <nowiki>http://www.your-clan-website.com/motd.html</nowiki> will display the motd.html file.
+
If the <code>motd_default.txt</code> contains any web programming language in it, whether directly or via a URL, the game will render the code using Internet Explorer.
  
 +
Both files are limited to a size of [http://www.matisse.net/bitcalc/?input_amount=2&input_units=kilobytes&notation=legacy 2 KB] (2,048 characters).
  
For a tutorial on how to create a MOTD that seamlessly fits into the TF2 chalkboard, visit: http://www.specialattack.net/node/39
 
  
http://hlds101.com/configuring.htm
+
A possible workaround for the files limitations (i.e., the size limit) is to place a link to a hosted <code>.html</code> file on the web. For example placing this as your <code>motd.txt</code>: <kbd><nowiki>http://www.your-clan-website.com/motd.html</nowiki></kbd> will display the <code>motd.html</code> file.
  
http://www.counterwiki.com/index.php/Motd.txt
+
 
 +
For a tutorial on how to create a MOTD that seamlessly fits into the TF2 chalkboard, go [https://web.archive.org/web/20170606133951/https://www.specialattack.net/content/how-create-tf2-chalkboard-style-motd-html here] or [http://hlds101.com/configuring.htm here].
  
 
== Maplist ==
 
== Maplist ==
The Maplist is a file used to list all maps that are playable to the server. If you decide to use a custom map voting plugin, make sure you put the map name in both the maplist.txt and the voting list for it to work correctly.
+
The Maplist is a file used to list all maps that are playable to the server. If you decide to use a custom map voting plugin, make sure you put the map name in both the <code>maplist.txt</code> and the voting list for it to work correctly.
SRCDS (Source Dedicated Server) allows for easily editing of this list of playable maps. which is found in orangebox/tf/maplist.txt
+
SRCDS (Source Dedicated Server) allows for easily editing of this list of playable maps. which is found in <code>orangebox/tf/maplist.txt</code>
  
To add custom maps, drop the .bsp file into the orangebox/tf/maps directory and then find the maplist.txt at orangebox/tf/maplist.txt in your server directories and then add its name on a new line to the list (when listing map names, use the exact name of the .bsp file, without including the .bsp extension).
+
To add custom maps, drop the <code>.bsp</code> file into the <code>orangebox/tf/maps</code> directory and then find the <code>maplist.txt</code> at <code>orangebox/tf/maplist.txt</code> in your server directories and then add its name on a new line to the list (when listing map names, use the exact name of the <code>.bsp</code> file, without including the <code>.bsp</code> extension).
  
 
== Cheating Prevention ==
 
== Cheating Prevention ==
 
===VAC===
 
===VAC===
Valve Anti-Cheat will automatically detect and ban many users that are using programs used for playing unfairly on server (examples being speed hacking, aimbot use and in some extreme cases, usage of sv_cheats related commands such as noclip).
+
Valve Anti-Cheat will automatically detect and ban many users that are using programs used for playing unfairly on server (examples being speed hacking and aimbot use).
[[Valve Anti-Cheat|VAC]] is enabled by default on all servers and requires the administrator to expressly disable it by adding the -insecure line to the launch options
+
[[Valve Anti-Cheat|VAC]] is enabled by default on all servers and requires the administrator to expressly disable it by adding the <kbd>-insecure</kbd> line to the launch options
  
 
===Server Settings===
 
===Server Settings===
Outside of VAC securing a server, the first line of defense against cheating is the server variable (console command) '''''sv_pure'''''. This variable controls where a client gets its information and acts as a means to restrict what kind of content and files can be modified/substituted on the player's side. This can be easily exploited by players if not configured properly. Its optional (but not vital) to set this variable to 1 or 2 if you don't want to allow any form of cheating on your servers. By default sv_pure is set to 0 which restricts nothing. Possible values are 0, 1, and 2 which are explained below.
+
Outside of VAC securing a server, the first line of defense against cheating is the server variable (console command) {{cvar|sv_pure}}. This variable controls where a client gets its information and acts as a means to restrict what kind of content and files can be modified/substituted on the player's side. This can be easily exploited by players if not configured properly. It's optional (but not vital) to set this variable to 1 or 2 if you don't want to allow any form of cheating on your servers. By default {{cvar|sv_pure}} is set to 0 which restricts only certain things based on a file. Possible values are -1, 0, 1, and 2 which are explained below. A client can potentially use modified files to gain an unfair advantage by doing things such as replacing enemy player models with ones that use bright colored skins, make walls invisible, add beacons onto the intelligence, or just about anything else you can think of. VAC doesn't protect against these kinds of exploits because they don't modify the game process itself.
  
;sv_pure 0
+
;<kbd>sv_pure -1</kbd>
: allows the client to specify the location of ANY game file. A client can potentially use modified files to gain an unfair advantage by doing things such as replacing enemy player models with ones that use bright colored skins, make walls invisible, add beacons onto the intelligence, or just about anything else you can think of. VAC doesn't protect against these kinds of exploits because they don't modify the game process itself. It's up to the server to decide what its clients can do.
+
: No file restrictions whatsoever.
  
;sv_pure 1
+
;<kbd>sv_pure 0</kbd>
:restricts where the client can get information from based on a white list (list of allowed content). The default white list is still set to allow custom player models as well as any potential exploits such as bright skins.
+
: Applies rules listed in cfg/pure_server_minimal.txt.
  
;sv_pure 2
+
;<kbd>sv_pure 1</kbd>
:forces the client to ignore ALL user content, and instead forces them to use the information supplied by Steam. While this is the most secure, sv_pure 2 will prevent the use all custom skins/models and even custom sprays.
+
: Applies rules listed in cfg/pure_server_full.txt and then applies the rules listed in cfg/pure_server_whitelist.txt. The default whitelist is still set to allow custom player models as well as any potential exploits such as bright skins. The default whitelist also allows for custom weapon models such as re-animations of viewmodels.
  
For more information on sv_pure servers, including information on the white list format, see [http://developer.valvesoftware.com/wiki/Pure_Servers Pure Servers] on the Valve Developer Wiki.
+
;<kbd>sv_pure 2</kbd>
 +
: Applies rules listed in cfg/pure_server_full.txt. Forces the client to ignore ALL user content and instead forces them to use the information supplied by Steam. While this is the most secure, <kbd>sv_pure 2</kbd> will prevent the use all custom skins/models and even custom sprays. However, some files like HUD layouts, sounds, and certain visual effects are still whitelisted and can be altered even at this level.
  
 +
For more information on {{cvar|sv_pure}} servers, including information on the white list format, see [[vdc:Pure Servers|pure servers]].
  
Many servers typically run sv_pure with a value of ''1'' together with a modified white list either to allow directories of content that are difficult or impossible to cheat with, or remove the ability for players to supply their own models.
+
Many servers typically run {{cvar|sv_pure}} with a value of ''1'' together with a modified white list either to allow directories of content that are difficult or impossible to cheat with, or remove the ability for players to supply their own models.
  
 
===Third Party Plugins===
 
===Third Party Plugins===
Several Third Party Plugins/Addons give extra protection against malicious players. See [http://wiki.alliedmods.net/SRCDS_Hardening SRCDS Hardening @ alliedmods.net] for more information and additional plugins.
+
Several third party plugins/addons give extra protection against malicious players. See [http://wiki.alliedmods.net/SRCDS_Hardening SRCDS Hardening] for more information and additional plugins.
  
 
== Command Line Options ==
 
== Command Line Options ==
http://developer.valvesoftware.com/wiki/Command_Line_Options
+
{{vdc|Command Line Options}}
 
 
== Quickplay ==
 
Quickplay is what allows servers to be connected to from the [[Main Menu]]'s ''Start Playing'' button.  There is a Steam Support Knowledgebase article that documents setting a server up for Quickplay, it can be found [https://support.steampowered.com/kb_article.php?ref=2825-AFGJ-3513 here].
 
  
 
== Example Server.cfg for TF2 dedicated server ==
 
== Example Server.cfg for TF2 dedicated server ==
Line 88: Line 96:
 
// Type of server 0=internet 1=lan
 
// Type of server 0=internet 1=lan
 
sv_lan 0
 
sv_lan 0
 
// Whether the server enforces file consistency for critical files
 
sv_consistency 1
 
  
 
// Collect CPU usage stats
 
// Collect CPU usage stats
Line 113: Line 118:
 
// -1 is the world, 0 is USA east coast, 1 is USA west coast
 
// -1 is the world, 0 is USA east coast, 1 is USA west coast
 
// 2 south america, 3 europe, 4 asia, 5 australia, 6 middle east, 7 africa
 
// 2 south america, 3 europe, 4 asia, 5 australia, 6 middle east, 7 africa
sv_region 0
+
sv_region -1
  
  
Line 119: Line 124:
 
// Rcon Settings //
 
// Rcon Settings //
  
// Password for rcon authentication
+
// Password for rcon authentication (Remote CONtrol)
 
rcon_password yourpw
 
rcon_password yourpw
  
Line 208: Line 213:
 
mp_restartround 0
 
mp_restartround 0
  
//Enable sudden death
+
// Enable sudden death
 
mp_stalemate_enable 1
 
mp_stalemate_enable 1
  
Line 214: Line 219:
 
mp_stalemate_timelimit 300
 
mp_stalemate_timelimit 300
  
// game time per map in minutes
+
// Game time per map in minutes
 
mp_timelimit 35
 
mp_timelimit 35
  
  
  
// Client CVARS //
+
// Client CVars //
  
 
// Restricts spectator modes for dead players
 
// Restricts spectator modes for dead players
 
mp_forcecamera 0
 
mp_forcecamera 0
  
// toggles whether the server allows spectator mode or not
+
// Toggles whether the server allows spectator mode or not
 
mp_allowspectators 1
 
mp_allowspectators 1
  
// toggles footstep sounds
+
// Toggles footstep sounds
 
mp_footsteps 1
 
mp_footsteps 1
  
// toggles game cheats
+
// Toggles game cheats
 
sv_cheats 0
 
sv_cheats 0
  
Line 242: Line 247:
 
mp_idledealmethod 2
 
mp_idledealmethod 2
  
// time (seconds) between decal sprays
+
// Time (seconds) between decal sprays
 
decalfrequency 30
 
decalfrequency 30
  
Line 255: Line 260:
 
sv_alltalk 0
 
sv_alltalk 0
  
// amount of time players can chat after the game is over
+
// Amount of time players can chat after the game is over
 
mp_chattime 10
 
mp_chattime 10
  
// enable party mode
+
// Enable party mode
// tf_birthday 1
+
tf_birthday 0
  
 
</pre>
 
</pre>
 
==Popular mods/addons==
 
 
===Additional Protection===
 
*[http://www.sourceop.com/modules.php?name=Downloads&d_op=viewdownload&cid=9 DoS Attack Fixer for TF2] - A server plugin used to prevent against Denial of Service attacks.
 
*[http://dblocker.didrole.com/ DBlocker] - DBlocker is an anti-cheat plugin.
 
 
===General===
 
*[http://www.sourcemm.net/ Metamod:Source] - Base for many other plugins
 
*[http://www.eventscripts.com/pages/Main_Page Event Scripts] - A powerful scripting Environment
 
 
 
===Admin Management===
 
*[http://www.mani-admin-plugin.com/index.php?option=com_frontpage&Itemid=1 Mani's Admin-Plugin]
 
*[http://www.sourcemod.net/ SourceMOD] - Also provides a large scripting platform for misc. plugins
 
*[http://www.beetlesmod.com/comm/ beetlesmod]
 
 
  
 
== See also ==
 
== See also ==

Latest revision as of 05:41, 12 January 2024

Installation

Windows-based Server Installation

For a step-by-step guide on setting up a basic Team Fortress 2 Windows Dedicated Server, see the Windows dedicated server page.

This short tutorial will guide you on how to create a Dedicated Server for Team Fortress 2 on a Windows-based computer. The current tool used for doing this is the Steam Console Client Tool (or Steamcmd). Steamcmd is an application that will completely install the latest version of the server content to your computer. If it is already installed when running Steamcmd, the tool will update the existing Dedicated Server installation to the latest released version.

You can install TF2-server by downloading the Steamcmd from: http://media.steampowered.com/installer/steamcmd.zip

Once you have downloaded this, run the tool from a command shell and a text windowed installer will automatically update/install your server. To save time and bandwidth when downloading files, it is wise to install the Steamcmd into the root folder of an existing Half-Life Dedicated Server installation.

An example command line option:

steamcmd +login anonymous +force_install_dir C:\tf2_server +app_update 232250 validate +quit

You may save this command line to a text file, rename it with the .bat extension which will convert it to a batch file. This batch file can be run any time your server needs an update.

For more detailed installation instructions visit: SteamCMD on the Valve Developer Community

MOTD

The MOTD ("Message Of The Day") is the message which appears upon successfully connecting to your server. A MOTD can be a simple message, or a complex website page. To modify the message, navigate to your orangebox/tf folder and edit the text in the files named motd_default.txt and motd_text_default.txt.

The difference between the two files, is that if the motd_default.txt file contains any web programming language of client side (HTML, CSS, JavaScript), whether writing directly to the file or displaying the content by providing a URL to the file, but the user has decided to disable HTML MOTDs - the content of motd_text_default.txt file will be used instead.

If the motd_default.txt contains any web programming language in it, whether directly or via a URL, the game will render the code using Internet Explorer.

Both files are limited to a size of 2 KB (2,048 characters).


A possible workaround for the files limitations (i.e., the size limit) is to place a link to a hosted .html file on the web. For example placing this as your motd.txt: http://www.your-clan-website.com/motd.html will display the motd.html file.


For a tutorial on how to create a MOTD that seamlessly fits into the TF2 chalkboard, go here or here.

Maplist

The Maplist is a file used to list all maps that are playable to the server. If you decide to use a custom map voting plugin, make sure you put the map name in both the maplist.txt and the voting list for it to work correctly. SRCDS (Source Dedicated Server) allows for easily editing of this list of playable maps. which is found in orangebox/tf/maplist.txt

To add custom maps, drop the .bsp file into the orangebox/tf/maps directory and then find the maplist.txt at orangebox/tf/maplist.txt in your server directories and then add its name on a new line to the list (when listing map names, use the exact name of the .bsp file, without including the .bsp extension).

Cheating Prevention

VAC

Valve Anti-Cheat will automatically detect and ban many users that are using programs used for playing unfairly on server (examples being speed hacking and aimbot use). VAC is enabled by default on all servers and requires the administrator to expressly disable it by adding the -insecure line to the launch options

Server Settings

Outside of VAC securing a server, the first line of defense against cheating is the server variable (console command) sv_pure. This variable controls where a client gets its information and acts as a means to restrict what kind of content and files can be modified/substituted on the player's side. This can be easily exploited by players if not configured properly. It's optional (but not vital) to set this variable to 1 or 2 if you don't want to allow any form of cheating on your servers. By default sv_pure is set to 0 which restricts only certain things based on a file. Possible values are -1, 0, 1, and 2 which are explained below. A client can potentially use modified files to gain an unfair advantage by doing things such as replacing enemy player models with ones that use bright colored skins, make walls invisible, add beacons onto the intelligence, or just about anything else you can think of. VAC doesn't protect against these kinds of exploits because they don't modify the game process itself.

sv_pure -1
No file restrictions whatsoever.
sv_pure 0
Applies rules listed in cfg/pure_server_minimal.txt.
sv_pure 1
Applies rules listed in cfg/pure_server_full.txt and then applies the rules listed in cfg/pure_server_whitelist.txt. The default whitelist is still set to allow custom player models as well as any potential exploits such as bright skins. The default whitelist also allows for custom weapon models such as re-animations of viewmodels.
sv_pure 2
Applies rules listed in cfg/pure_server_full.txt. Forces the client to ignore ALL user content and instead forces them to use the information supplied by Steam. While this is the most secure, sv_pure 2 will prevent the use all custom skins/models and even custom sprays. However, some files like HUD layouts, sounds, and certain visual effects are still whitelisted and can be altered even at this level.

For more information on sv_pure servers, including information on the white list format, see pure servers.

Many servers typically run sv_pure with a value of 1 together with a modified white list either to allow directories of content that are difficult or impossible to cheat with, or remove the ability for players to supply their own models.

Third Party Plugins

Several third party plugins/addons give extra protection against malicious players. See SRCDS Hardening for more information and additional plugins.

Command Line Options

Command Line Options on the Valve Developer Community

Example Server.cfg for TF2 dedicated server

// General Settings //

// Hostname for server.
hostname yourserver.com TF2 Server

// Overrides the max players reported to prospective clients
sv_visiblemaxplayers 24

// Maximum number of rounds to play before server changes maps
mp_maxrounds 5

// Set to lock per-frame time elapse
host_framerate 0

// Set the pause state of the server
setpause 0

// Control where the client gets content from 
// 0 = anywhere, 1 = anywhere listed in white list, 2 = steam official content only
sv_pure 0

// Is the server pausable
sv_pausable 0

// Type of server 0=internet 1=lan
sv_lan 0

// Collect CPU usage stats
sv_stats 1



// Execute Banned Users //
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip



// Contact & Region //

// Contact email for server sysop
sv_contact emailaddy@google.com

// The region of the world to report this server in.
// -1 is the world, 0 is USA east coast, 1 is USA west coast
// 2 south america, 3 europe, 4 asia, 5 australia, 6 middle east, 7 africa
sv_region -1



// Rcon Settings //

// Password for rcon authentication (Remote CONtrol)
rcon_password yourpw

// Number of minutes to ban users who fail rcon authentication
sv_rcon_banpenalty 1440

// Max number of times a user can fail rcon authentication before being banned
sv_rcon_maxfailures 5



// Log Settings //

// Enables logging to file, console, and udp < on | off >.
log on

// Log server information to only one file.
sv_log_onefile 0

// Log server information in the log file.
sv_logfile 1

// Log server bans in the server logs.
sv_logbans 1

// Echo log information to the console.
sv_logecho 1



// Rate Settings //

// Frame rate limiter
fps_max 600

// Min bandwidth rate allowed on server, 0 == unlimited
sv_minrate 0

// Max bandwidth rate allowed on server, 0 == unlimited
sv_maxrate 20000

// Minimum updates per second that the server will allow
sv_minupdaterate 10

// Maximum updates per second that the server will allow
sv_maxupdaterate 66



// Download Settings //

// Allow clients to upload customizations files
sv_allowupload 1

// Allow clients to download files
sv_allowdownload 1

// Maximum allowed file size for uploading in MB
net_maxfilesize 15



// Team Balancing //

// Enable team balancing
mp_autoteambalance 1 

// Time after the teams become unbalanced to attempt to switch players.
mp_autoteambalance_delay 60

// Time after the teams become unbalanced to print a balance warning
mp_autoteambalance_warning_delay 30

// Teams are unbalanced when one team has this many more players than the other team. (0 disables check)
mp_teams_unbalance_limit 1



// Round and Game Times //

// Enable timers to wait between rounds. WARNING: Setting this to 0 has been known to cause a bug with setup times lasting 5:20 (5 minutes 20 seconds) on some servers!
mp_enableroundwaittime 1

// Time after round win until round restarts
mp_bonusroundtime 8

// If non-zero, the current round will restart in the specified number of seconds
mp_restartround 0

// Enable sudden death
mp_stalemate_enable 1

// Timelimit (in seconds) of the stalemate round.
mp_stalemate_timelimit 300

// Game time per map in minutes
mp_timelimit 35



// Client CVars //

// Restricts spectator modes for dead players
mp_forcecamera 0

// Toggles whether the server allows spectator mode or not
mp_allowspectators 1

// Toggles footstep sounds
mp_footsteps 1

// Toggles game cheats
sv_cheats 0

// After this many seconds without a message from a client, the client is dropped
sv_timeout 900

// Maximum time a player is allowed to be idle (in minutes), made this and sv_timeout equal same time?
mp_idlemaxtime 15

// Deals with idle players 1=send to spectator 2=kick
mp_idledealmethod 2

// Time (seconds) between decal sprays
decalfrequency 30



// Communications //

// enable voice communications
sv_voiceenable 1

// Players can hear all other players, no team restrictions 0=off 1=on
sv_alltalk 0

// Amount of time players can chat after the game is over
mp_chattime 10

// Enable party mode
tf_birthday 0

See also