Setup and Manage a Dedicated Server

From BiaSDK
Jump to: navigation, search

The dedicated server in Brothers In Arms is run via a ucc commandlet called "ServerCommandlet". You run the dedicated server by changing to the Brothers In Arms System folder and specifying the argument "server" to ucc.exe, like this...

ucc server <url> <-option> <-option> <-option>

Where <url> is the URL line for the map that you want to start with, for example...

[=MP_Warehouse?game=gbxGameplay.WargameMultiplayer?MaxPlayers=4?ServerName=MyServer?Password=secret?SystemLink=]

...the map name appears first, followed by any optional URL arguments (prepended with a '?' character).

The "?SystemLink" option runs the server as a LAN server (no internet connections allowed).

The "?Password=" option will require the player connecting to the server to provide the server password. If no password is desired, simply leave off this URL option.

The <-option> part of the "ucc server" command can contain optional command line switches. Some of these are:

-ini=BiA_Server.ini (would use the .ini file BiA_Server.ini instead of the game default BiA.ini file. If you use this option, you should copy Default.ini to BiA_Server.ini before running the dedicated server).

-log=server.log (send all log file output to the specified file name)

Specifying a "-ini=" option allows you to create a .ini file that is specifically geared to the dedicated server and will NOT be overwritten by the Profile folder .ini files.

Specifying a "-log=" option allows you to run the dedicated server AND the client on the same machine and not have the output of one overwrite the output of the other.

You may want to create a .bat batch file that you can use to run the dedicated server. There is already a RunServer.bat file in the Brothers In Arms System folder, so you may want to modify that one. For example...

@echo off
:10
ucc server MP_Ambush?maxplayers=2 -ini=BiA_Server.ini -log=server.log
copy server.log servercrash.log
goto 10

When the dedicated server is started, it will wait for number of players to join the lobby and be ready (i.e. selected a Fire or Assault team). Once all players are ready, the game will automatically start (with the standard 5 second countdown timer). If you start up a dedicated server with MaxPlayers=2, the server will wait for exactly 2 players to join and be ready. If you start a dedicated server with MaxPlayers=4, the server will wait for exactly 4 players to join and be ready (i.e. you can't start the game with only 3 players).

When the mission is over (one team completes the mission or the time limit expires), the dedicated server will automatically switch to the next map (after the timeout at the end of the After Action report screen).

Currently the only way to specify which maps you want to run on the dedicated server is to edit the DefMPMaps.int file found in the Brothers In Arms System folder (note, for localized builds, this file will be DefMPMaps.est, DefMPMaps.det, DefMPMaps.frt, or DefMPMaps.itt). Just remove the lines for the map names that you do NOT want to run. For example, to have the dedicated server only run the MP_Ambush and MP_Codebook map, you would have this in that file...

[Public] MPMissions=(Map="MP_Ambush",Id=1,Name="Ambush",NameLong="Ambush at Anterbien",Image="t_interface_mb.chaper_preview.mp_ambush",Briefing=" The American soldiers are trying to deliver orders to a convoy waiting on the far side of the village.| German troops have set up an Ambush to stop them.") MPMissions=(Map="MP_Codebook",Id=5,Name="Dawn",NameLong="Etienville Dawn",Image="t_interface_mb.chaper_preview.mp_codebook",Briefing=" American troops have discovered a valuable German codebook in the town of Etienville.| The Germans must prevent the Americans from taking it and attempt to recover the codebook themselves.")


Web Based Admin for Dedicated Servers

You should create a custom BiA.ini file to use with your dedicated server. Copy the Default.ini file in the Brothers In Arms 'System' folder and name the new file BiA_Server.ini, then use the "-ini=BiA_Server.ini" command line option when starting the dedicated server.

In your BiA_Server.ini file, search for the following line in the [Engine.GameEngine] section...

ServerActors=UWeb.WebServer

...and uncomment that line by removing the ';' character.

Then search in that same file for the [UWeb.WebServer] section and change 'bEnabled=False' to 'bEnabled=True'. This will start up the dedicated server Web based Admin feature.

You should also change the Admin name and password. Find the [UWeb.SimpleAdmin] section and change "Admin" and "secret" to be your name and password that you want to use to log in to the Web based Admin service. For example, you might change it to this...

AdminName="MattBaker" AdminPassword="moveout123"

Note: The AdminName and AdminPassword are CASE SENSITIVE which means that you must enter the username and password with the same uppercase and lowercase letters as you have stored in the .ini file.

If you already have a web server running on port 80 of your dedicated server machine, you can change the port number that the HTTP Web based Admin service will use. You can do this by adding a 'ListenPort=' line below all the other lines in the [UWeb.WebServer] section. For example, if you want the Web based Admin service to listen on port 90, you would have...

[UWeb.WebServer] Applications[0]="UWeb.SimpleAdmin" ApplicationPaths[0]="/Admin" DefaultApplication=0 bEnabled=True ListenPort=90

Save the BiA_Server.ini file and start up the dedicated server. Once the server is up and running, you should be able to log in to the Web based Admin service by using an internet web browser to connect to your server's IP address (if you have specified a ListenPort, be sure to append the port number with a colon after the IP address, like this: http://127.0.0.1:90).

You should get a window asking for the Admin name and password. Once you have entered the correct Admin name and password, you will see a simple interface showing the name of the server, how many players are currently on the server. If you want to kick a player off the server, there's a simple interface that allows you to select a player and then kick them from the server. There's also a simple interface that allows you to select a map to switch to if you want to change maps. There is also a feature that allows you to broadcast a text message to all players on the server to alert them if you are going to switch maps or shut the server down (currently this broadcast message only works WHILE the game is being played, not while people are waiting in the lobby for the game to start or waiting in the After Action screen waiting for the next map to start).

The Web based Admin feature is VERY bare bones currently. There isn't any way to have multiple Admins each with their own AdminName and AdminPassword. There isn't any way to kick and ban someone from the server.

Some of these features may be added at a later date.