
|
Operation Flashpoint Multiplayer
Server
|
 |
Everything you wanted to know about a dedicated server but were afraid to
ask.... Dedicated server documentation is sketchy at best, and most
information had to be discovered during testing. I started with
information found from the Avon Lady's website and chased links from
there. These were my goals for a dedicated server:
- Run under Windows 2000 as a Service
- Remote Administration
- Automated Map Rotation
- Custom Maps & Mods
Run under Windows 2000 as a Service
The benefits of running as a service should be obvious - it lets it run
"unattended" in that it allows for restarts if the server crashes, as
well as eliminating the need to have a user logged onto the
console.
Requirements
To run it as a service, you'll need the following components:
- instsrv.exe: A Windows Resource Kit tool allows you to install a
service at the command line. Any version will do, even the NT 4.0
version. You may download this from
my FTP site here.
- srvany.exe: This Windows Resource Kit tool allows you to run an
application as a service by "hosting" the application. Any
version will do, even the NT 4.0 version. You may download this from
my FTP site here.
- Dedicated Server executable: obtain the latest version from the
downloads section of the Operation
Flashpoint homepage.
Steps required to run as a service:
NOTE: This isn't as hard as it may seem!
1. Install and run the game normally, under the user account with whom you
intend to run the server. This is required only one time in order to set
the user's preferences. This is important because the OFP server will not
run with a user who has not been configured. NOTE: *IF* you
don't do this, the OPFLASHPREFERENCES.EXE will run instead of the OFP_SERVER.EXE
when the service is started!
NOTE: The following steps are adapted directly from the Microsoft
Knowledge Base article: HOWTO: Create a User-Defined Service (Q137890)
2. Copy the SRVANY.EXE file to the server - ideally to a system
folder or even the OFP folder. This file must stay on the server.
The INSTSRV.EXE file is required only for the next step, but should be copied to
the same location to keep things simple.
3. Use the following command line (without quotes) to install the
SRVANY tool:
"<path>\INSTSRV.EXE OFPServer
<path>\SRVANY.EXE"
... where the <path> is the folder to find the tools, and
"OFPServer" is the name of the service we are installing. For
example, on my setup this was:
"d:\instsrv.exe
OFPServer d:\ofp\srvany.exe"
This will install the appropriate files and settings to run the SrvAny
service, which acts as a "host" for the OFP_Server program.
If you open regedit, you will notice that the service is located under the
\SrvAny registry key, while the service name is "OFPServer":
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SrvAny]
"DisplayName"="OFPServer"
"ImagePath"="c:\winnt\SrvAny.exe"
Don't be alarmed - this is expected! You will work with the "OFPServer"
service, which is technically an "alias" under which the SrvAny
service runs. This is what I referred to when I described the SrvAny
service as a "host" or "proxy" for the OFPServer
application.
4. Configure the registry:
Copy the following section into Notepad:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SrvAny\Parameters]
"Application"="d:\\ofp\\ofp_server.exe"
"AppParameters"="-config=server.cfg"
"AppDirectory"="D:\\ofp"
Replace the path "D:\OFP" with the
appropriate path on your server. Note that the double backslashes
"\\" are required for the path!
The values are:
"Application" - this value tells the SrvAny service what
program to run as a service. This makes SrvAny act as a "Host"
service for the OFP_Server.exe program.
"AppParameters" - this value invokes the server.cfg
file. Therefore the server.cfg file should be present on the server before
launching the service! This is further discussed in the "configuration" link to
the left....
"AppDirectory" - this value is the folder where the program is
located. This is optional, but I use it placed it here just to be sure.
5. Choose File -> "Save As..." and name this as "OFPServer.reg"
- WITH the quotes! Saving with the quotes will allow you to save the file with the
.REG
extension, because Notepad will automatically try to use the .TXT file
extension.
6. Choose "All file types" under the "Save
as type" field.
7. Save the file somewhere convenient, like your
desktop. When complete, the file should have a registry icon.... if it has a
notepad text icon, then you'll need to manually rename the file from .TXT to
.REG.
8. Double-click on the OFPServer.reg file to add it into the
registry. Say "yes" to acknowledge the confirmation dialog
box. Now you have added the "behind the scenes" information to
the registry that allows the dedicated server application to run as a service.
9. Open the Services management console to set user account under
which the service should start, and to set the recovery options. I recommend
setting all of the recovery steps to "Restart the Service" so it will
remain up.
Observations.
- I've noticed that the server will utilize around 26-30MB of memory upon
start, and that can grow up to 75-130MB memory utilization. No doubt
the map size and number of players that connect will make an impact to these
numbers.
- If left completely alone, the initial memory utilization will very
slowly increase even if no one connects. This may indicate a memory
leak in the executable, so I recommend restarting the server on a
semi-regular schedule - say 2x per week (during slow times).
- Now that the server is running as a service, you may leave it like
this, but it will not be fully automated and won't do you much good unless
you are hosting a LAN party or something like that. At the very least,
you need to set up a map rotation so the server will run maps when players
connect. I've sorted everything in the links to the left....
|