Battlefield 2 (BF2) is a first-person military action game. The dedicated server component can be run as a Windows Service using FireDaemon Pro, which allows you to have the dedicated server start automatically at boot prior to login, start multiple instances of the dedicated server and more. This HOWTO will show you how to set it up. You can also use FireDaemon Fusion to manage FireDaemon and other Windows services via a web browser.
Battlefield 2 Dedicated Server Setup
Create an account at Battlelog.co so you can download the server files and register your server.
Download the Battlefield 2 Dedicated Server files from here. You will need to login prior to being able to download the files. The download is large (> 300 MB).
Install the dedicated server files into the directory of your choice (typically C:\Program Files\EA Games\BF2Server). Make sure you install PunkBuster if it is a public server.
Battlefield 2 Dedicated Server requires two configuration ("con") files. One configuration file contains the map list and the other the server settings. The simplest way to create a "con" file is to start the BF2ServerLauncher.exe file in the BF2Server folder.
If you click on the Start button in the BF2ServerLauncher, the dedicated server will launch using the default settings. Two "con" files (_mapList.con and _serverSettings.con) will be created in the directory: C:\Users\<user>\Documents\Battlefield 2\ServerConfigs. <user> is the name of the user you logged in as. For example:
The "con" files are text files and can be edited with your favourite text editor. Example "con" files can be found at the end of this HOWTO.
If you wish, you can create your own server configuration "con" files instead of using the default ones. To do this click on Plus (+) button in the BF2ServerLauncher. You will see the following dialog box. Type in a configuration name for your server and click OK - remember you can create multiple server profiles.
You will now be able to edit all the server settings and choose the maps to include your map cycle. Once you have finished click on the Save button in both sections.
A few catches
GOTCHA #1: If you use this technique to create custom configuration files, the map cycle is included with the server settings in one file. You will need to hand-edit the "con" file and place the map cycle in a separate file; otherwise, BF2 DS doesn't pick up your custom map cycle.
GOTCHA #2: If you use the +maplist command line option ... the BF2 DS only reads the file named _mapList.con. Any other file name will not work!
GOTCHA #3: "con" files can be stored anywhere on your hard disk. The default "con" (maplist.con and ServerSettings.con) files are found under the BF2 installation directory in the mods\bf2\settings folder. Edit these directly if you don't wish to set command-line options.
Battlefield 2 Dedicated Server Setup Under FireDaemon
Download and install FireDaemon Pro into the directory of your choice, typically C:\Program Files\FireDaemon.
Next, start the FireDaemon GUI from the desktop shortcut. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Adjust the paths to suit your installation. Note the required parameters.
Executable: The path to your BF2ServerLauncher.exe file. The path for the purposes of this HOWTO is C:\Program Files (x86)\EA Games\BF2Server\BF2ServerLauncher.exe.
Working Directory: The directory containing your BF2ServerLauncher.exe file. The path for the purposes of this HOWTO is C:\Program Files (x86)\EA Games\BF2Server.
The most important field on the tab is the Parameters. The Parameters defines the location of your "con" files.
If you choose to use the default "con" files (_mapList.con and _serverSettings.con), the complete value of the parameters field is:
+config "C:/Users/USERNAME/Documents/Battlefield 2/ServerConfigs/_serverSettings.con" +mapList "C:/Users/USERNAME/Documents/Battlefield 2/ServerConfigs/_mapList.con" +modPath mods/bf2 +ignoreAsserts 1
If you run the FireDaemon service as a specific user this command line can be shortened to:
+config "@HOME@/ServerConfigs/_serverSettings.con" +mapList "@HOME@/ServerConfigs/_maplist.con" +modPath mods/bf2 +ignoreAsserts 1
Note that the slashes are the wrong way around in both instances, and remember to adjust the paths and configuration files to suit your installation.
Now click on the Settings tab. If you DON'T want to see your dedicated server running, uncheck the Interact with Desktop check box. You can optionally run your Battlefield 2 server as the user you installed it as. In the Logon Account field type your username (e.g. Administrator) and then enter the user's password twice in the Password and Confirm fields. You can change the Process Priority to allocate more CPU time to the dedicated server or specify which CPU or core the dedicated server will run on (in the case of multi-processor, hyperthreaded or multi-core CPUs).
Now click on the Lifecycle tab. Uncheck Graceful Shutdown as BF2DS doesn't respond to it.
Now click OK to finish setup and start your Battlefield 2 server!
Sample Configuration Files
Below is a sample ServerSettings.con file:
v.serverName "FireDaemon"
sv.password ""
sv.internet 0
sv.serverIP ""
sv.serverPort 16567
sv.welcomeMessage ""
sv.punkBuster 0
sv.allowFreeCam 0
sv.allowExternalViews 1
sv.allowNoseCam 1
sv.hitIndicator 1
sv.maxPlayers 64
sv.numPlayersNeededToStart 2
sv.notEnoughPlayersRestartDelay 15
sv.startDelay 15
sv.endDelay 15
sv.spawnTime 15
sv.manDownTime 15
sv.endOfRoundDelay 15
sv.ticketRatio 100
sv.roundsPerMap 3
sv.timeLimit 0
sv.scoreLimit 0
sv.soldierFriendlyFire 100
sv.vehicleFriendlyFire 100
sv.soldierSplashFriendlyFire 100
sv.vehicleSplashFriendlyFire 100
sv.tkPunishEnabled 1
sv.tkNumPunishToKick 3
sv.tkPunishByDefault 0
sv.votingEnabled 1
sv.voteTime 90
sv.minPlayersForVoting 2
sv.teamVoteOnly 1
sv.gameSpyPort 29900
sv.allowNATNegotiation 0
sv.interfaceIP
sv.autoRecord 0
sv.demoIndexURL ""
sv.demoDownloadURL "[URL]http://[/URL]"
sv.autoDemoHook "adminutils/demo/rotate_demo.exe"
sv.demoQuality 1
sv.adminScript "default"
sv.timeBeforeRestartMap 30
sv.autoBalanceTeam 0
sv.teamRatioPercent 100
sv.coopBotRatio 50
sv.coopBotCount 16
sv.coopBotDifficulty 50
sv.voipEnabled 1
sv.voipQuality 3
sv.voipServerRemote 0
sv.voipServerRemoteIP
sv.voipServerPort 55125
sv.voipBFClientPort 55123
sv.voipBFServerPort 55124
sv.voipSharedPassword
sv.useGlobalRank 1
sv.useGlobalUnlocks 1
sv.noVehicles 0
sv.sponsorText ""
sv.sponsorLogoURL ""
sv.communityLogoURL ""
sv.radioSpamInterval 6
sv.radioMaxSpamFlagCount 6
sv.radioBlockedDurationTime 30
sv.numReservedSlots 0
sv.friendlyFireWithMines 0
Below is a sample MapList.con file:
MapList.append kubra_dam gpm_cq
MapList.append gulf_of_oman gpm_cq
MapList.append greatwall gpm_cq
MapList.append fushe_pass gpm_cq