Battlefield: Bad Company 2/Dedicated servers

Hosting a server in Battlefield can prove a highly entertaining yet costly venture. Due to Dice's stance of "protecting the integrity of the game", hosting your own dedicated server is impossible in Battlefield: Bad Company 2. Instead, the ability to host servers has been given to various server hosts, who sell the servers to interested parties.

There are some who claim they have managed to obtain the code and the ability to host their own servers, but this information is unreliable and must be used with caution.

Most server hosts will provide you with access to a few text files that you can use to customize your own server. The most important three, however, are listed below. There are many other files, but the scope of this guide is to cover how to play the game, not how to host servers. This information should be enough to get you started.

ServerOptions.ini
The first file that players should look at is ServerOptions.ini. There are six important fields listed here:
 * The Banner URL. This direct link to a PNG file that is exactly 512x64 pixels is what appears above the server description when the game is loading.
 * Punkbuster is EA's anti-cheating measure for the game. The system keeps cheaters off of your servers, but there are records of legitimate players being disconnected for various reasons. It also can't pick up on every cheating method, as the arms race between cheaters and anti-cheating solutions continues to this day.
 * Ranked determines whether or not the server is ranked. If turned on, the server will track and report each players' stats to the EA's stats server, where the players' stats are kept, and update them. Overrides any password; a server can be ranked or password protected, but not both. Additionally, neither stats, points, nor kill feeds are recorded if there are fewer than 5 players in the server.
 * The Server Description appears beneath the Banner URL during map loading times.
 * The Server Name is, naturally, the name of the server. It appears in the server browser.

Maplist.txt
This text file contains a list of maps that the server will run. It will run all the maps from top to bottom. In order for a map to be found, however, it must be formatted properly. The proper format is the game mode in all caps, followed on the next line by the map list. It appears to be impossible to switch game modes (even if it were possible, it would be difficult to switch from a 32 player Rush game mode to a 16 player Squad Deathmatch or an 8 player Squad Rush mode without kicking most players), but it is possible to determine the number of rounds each map has.

The four game modes are:

The map listings are as follows:

To run the newer Vietnam maps, chances are the server must be modified to support the maps. How this is done varies from host to host, but once performed, it can be easily undone. The modification must be reverted before the host can run the older maps again.

Here is the map list for the Vietnam expansion:

A final parameter that can be passed in is the number of rounds that will be played. The default is two rounds, with each team switching sides after each round.

Therefore, to have your server run 1 round of Atacama Desert and 3 rounds of Isla Inocentes on Rush, your Maplist.txt should look like this example:

Entering a value of 0 results in the default value.

ReservedSlotsList.txt
Enter player names in this text box to reserve slots for these people when they come in. No slots are automatically reserved; an 8 player server will fill up to 8 players until a person on the reserved list enters. The game will then kick one of the players in the game to make room for the reserved player.

Startup.txt
Consisting mostly of boolean (true/false) values, this file contains a few server options that the admin can set.
 * Crosshair: Displays the crosshair when players are not zoomed in with their weapons.
 *  Friendly Fire: Turn friendly fire on and off. If off, the only way to kill a friendly player is through Destruction 2.0.
 * Game Password: Password locks the game. This value will be disregarded if the server is set to "ranked" (see above).
 * Hardcore Mode: Enables Hardcore mode for higher realism. The player's HUD is completely disabled, players habve 20% less health, and kill cams are off.
 * Kill Cam: When you die, the kill cam shows you the player who killed you, along with a few of their statistics. The statistics will be disabled if ranking is on but there are fewer than 5 players. If the server is unranked, the statistics will be displayed regardless of the number of players there are in the game.
 * Minimap: Toggles the minimap at the bottom right of the screen on and off.
 * Minimap Spotting: Enables players to see the location of spotted enemy forces on the minimap.

Other Files
The following four files are the most important files that you'll need to host servers and will be the only ones covered in this guide, but for the curious, the other files include:
 * Punkbuster Config File (/pb/pbsv.cfg)
 * Punkbuster Bans (/pb/pbbans.dat)
 * Punkbuster Config File 2 (/pb/pbsvuser.cfg)
 * Punkbuster Log Config (/pb/pbsvlog.cfg)
 * Custom PB 1 (/pb/custompb1.cfg)
 * Custom PB 2 (/pb/custompb2.cfg)
 * Custom PB 3 (/pb/custompb3.cfg)
 * Ban List (banlist.txt)
 * Text Chat Moderation List (textchatmoderationlist.txt)
 * PBUCon (/pb/pbucon.use)

Additional reading can be found on any search engine using these file names.