Servers

Like all multiplayer games based on Valve's Source Engine, Team Fortress 2 uses a client-server model. The client is the copy of the game running on a player's computer, while the server is the software which players connect to. There are currently several thousand Team Fortress 2servers running worldwide.

A server is responsible for many aspects of Team Fortress 2 gameplay. It responds to players' actions by updating their respective locations and states, e.g. firing a weapon, before determining an appropriate response, e.g. dealing damage to a target, and then broadcasting the results to the players, e.g. displaying a damage dealt value. The server also handles events that are not controlled by players, e.g. map time, Sentry Gun behavior, etc.

Contents

Benefits

Instead of joining an existing server, players can opt to create their own servers to host the game. This can allow the host player to set the map rotation, determining which particular maps and subsequent game modes are played. Additionally, other built in settings can be altered, such as gravity, class slot limit, Highlander limitations and so on. Custom modifications may also be installed on the server to provide alternate gameplay.

Types

There are 2 types of servers that can be run using the Source engine.

Listen/Local server

A Listen Server is a basic server running within a player's TF2 client. It can be easily created through selecting the Create Server button at the main menu. Other players can connect to the server, but the overhead of running a regular client on the same system will often strain the host player's hardware. These types of servers are best suited to LAN-based events.

Dedicated server

A Dedicated Server is a standalone server that does not require Steam to run. Dedicated servers are preferred due to decreased overhead, among other factors. Additionally, many dedicated servers are run on high-end hardware in data centers, providing high performance and fast, reliable connections to players, which can seldom be guaranteed on residential connections.

Requirements

While GSPs (Game Server Providers) generally use high-end dedicated hardware to run game servers, anybody can create a server by using a computer running:

Update history

The affinity of the main thread is not set explicitly for dedicated servers. This will properly load balance multiple instances of the dedicated server running on a multi-processor machine. The affinity is still set to CPU 1 for clients and listen servers.

Removed mp_friendlyfire cvar for servers. Team Fortress 2 breaks in a number of ways if this is on.

Replay publishing system will try to do a rename for local HTTP mode but will manually copy and delete the file if the rename fails, which can happen if the source and destination are on different volumes.

Fixed threading issues on Linux, which was causing major lag spikes.

Fixed replay data cleanup system, which cleans up stale data at the end of each round. This asynchronous operation can be explicitly invoked by executing a replay_docleanup command on the server.

Added ConVars sv_rcon_maxpacketsize and sv_rcon_maxpacketbans to allow server admins to control the maximum RCON packet size and whether or not users get banned for exceeding that limit. The defaults reflect the existing behavior.

Fixed map triggered annotation events not working on dedicated servers.

Votes created by a dedicated server no longer trigger a failed vote cooldown.

Using a Name Tag while in game notifies everyone of the name change.

[Undocumented] Servers no longer require a restart during the full moon period to allow players to equip Halloween items.

Added sv_namechange_cooldown_seconds, to throttle clients from changing their name too rapidly. (Defaults to 20 seconds)

Added sv_netspike_on_reliable_snapshot_overflow to selectively enable the automatic dumping of netspike file if a client drops due to "reliable snapshot overflow". (defaults to 0, which disables the debugging)

Added check to prevent player names from containing color codes.

Fix a bug that caused gameservers to not properly receive client inventory updates. (Frequent cause of the "The server you are playing on has lost connection to the item server" error message.)