Grein frá G8 sem ég kóperaði hér inná;


Since there seems to be a lot of questions regarding setting up and running a BF1942 server, I created a FAQ. Enjoy!

Version 2002091901 (changed to reflect the dedicated server release and many new issues, including how to keep the remote admin enabled after map changes!)

*The majority of this info is already in the readme (RTFM) but I have condensed it into a specific Server FAQ (with some more detailed info where necessary). Hope this helps :)


1. How do I run a dedicated server without having to enter my info into the DedicatedServer.exe every time?

You need to enter the server config parameters into its config file. The file is called ServerSettings.con, located in Settings folder for the application (usually C:\Program Files\EA GAMES\Battlefield 1942 Server\Settings). The DedicatedServer.exe can be used when first setting up the server, then you can manually edit the ServerSettings.con after the first time it is run. See this post from Saracen (thanks!) for a full descrption of the server config file options.

DO NOT USE DedicatedServer.exe MORE THAN ONCE if you do not want to enter your info every time you start the server. You must start the server from a shortcut which starts the game as a server, or start the server as a service (more below), or write a batch file to start the server (FAQ-todo).

The simplest method is to modify the shortcut file on your desktop to include the following switches:

+restart 1 +hostServer 1 +dedicated 1

So the Target for the shortcut would look like:

“C:\Program Files\EA GAMES\Battlefield 1942 Server\BF1942.exe” +restart 1 +hostServer 1 +dedicated 1

Rename that shortcut to something apropriate like ‘BF1942 Server’ and double click it. The server should launch with the settings you entered into the ServerSettings.com file.


2. How do I set the admin password and use remote commands?

You may set the admin password in two ways:

A. Enter it whenever you (re)start the server at the server console.
B. Create a file called ServerAutoexec.con in the Settings folder of your install directory.

To set the admin password at the server console, get in front of the server/black window and hit the ` key to bring up the console (also called the ~ key). This will take the console out of status display mode (where it shows you FPS) and into entry mode where you can enter console commands. When you get the > prompt, type:

admin.enableremoteadmin <password>

where <password> is any password of your choice that is all numbers OR letters, BUT NOT BOTH AND NO SPACES!

After you have set the password on the server console, you can use the same command from your client when you connect to the server. So, fire up your game and connect to your server. Now open the console ingame with the ` key and issue the following command:

admin.enableremoteadmin <password>

where <password> is the password you set before at the server console.

You should now be authed as an admin and able to issue remote commands. To issue a remote command, use the following command:

admin.execremotecommand “command”

where command is any command you would normally run from the server console. THE REMOTE COMMAND MUST BE ENCLOSED IN QUOTES. For example, to kick a user number 15 you would issue this:

admin.execremotecommand “admin.kickplayer 15” or to ban player 15:
admin.execremotecommand “admin.banplayer 15”

To set the admin password in a config file (so it is enable on server start and survives server restart), create a file in your Settings directory called ServerAutoexec.con Enter any admin commands you want to be executed when the server starts into this file. For example, to make sure your admin password is applied every time the server starts you would place the following line/command into the file:

admin.enableremoteadmin <password>

Now you will always have your admin password enabled when the server (re)starts! Many thanks to s0z0 for locating the name of this file inside the server binary!


3. How do I kick/ban people from my server?

Read #2 again if you are not sitting in front of the server/console. If you are sitting in front of your server/console (i.e. NOT remote), then you just issue the admin command right into the console (i.e. game.listplayers and admin.kickplayer <number>)


4. How do I use the RemoteConsole tool included in the AdminTool folder?
WARNING - CURRENTLY ENABLING ACCESS FOR THIS TOOL WILL CAUSE THE SERVER TO EXHIBIT THE “ASE” ERROR/HANG UPON CHANGING MAPS. THIS IS A BUG. ONLY ENABLE ACCESS FOR THIS TOOL IF YOUR SERVER DOES NOT CHANGE MAPS."

DICE included a RemoteConsole tool which allows you to run a remote console on your client computer (without running the full game). In order to allow this tool to remotely access the server, you must enable the access on the console of the server or in the ServerAutoexec.com file located in the Settings folder). The command is as follows:

admin.enableremoteconsole <userid> <password> [port] (the port number is optional)

where <userid> is the username you will use, <password> is any password of your choice. The userid and password should be all numbers OR letters, BUT NOT BOTH AND NO SPACES! You may also specify an alternate port (the default is 4711) on which the server will listen for incoming connections from the RemoteConsole tool.

After enabling access, run the RemoteConsole.exe on your client computer in a command window. cd to C:\Program Files\EA GAMES\Battlefield 1942 Server\AdminTool and run the following command:

RemoteConsole -u <username> -p <password>

where <username> and <password> are the ones you just set in the server console ( or in the ServerAutoexec.con file in the Settings folder).


5. How many users can I have on my server? How big of a connection do I need?

These are rough estimates, err on the high side, and aim for best performance (sure you could get more on less but that's when you get laggy/crummy servers):

'How big' primarily depends on bandwidth. A *good* DSL connection (1.5/768) can handle about 8-10 players MAX. Slower DSL (such as residential 1.5/256) would only be able to support about 4 players at best (same for cable as that is usually 256 to 384 on the upload). If you have a 1 Mb SDSL connection (or 1 Mb on your cable upload) you should be able to support a 12 player server

As a rough rule of thumb, each player requires anywhere from 50 to 80 Kb/sec. You need a *minimum* of a T1 to support a 16 player server, dual T1 (3 Mb) for a 32 player server, and just over 6 Mb for a 64 player server (although that can hit up to 7 Mb/sec depending on how many people are connecting and downloading maps). Basically you need some serious bandwidth for anything over a 16 player server and it should be dedicated hardware (i.e. it's only a server, no GUI or other apps running on it).

As far as the hardware, here is my rough estimate/guide based upon my actual experiences:

16 Players = 1 Ghz/128 Mb RAM
32 Players = 1.5+ Ghz/256 MB RAM
48+ Players = 2+ Ghz/512 Mb RAM

THE SERVER WILL CONSUME 85 TO 100% OF YOUR CPU. This means YOU CANNOT RUN A SERVER ON AND PLAY FROM THE SAME MACHINE. SERVERS MUST BE DEDICATED FOR OPTIMAL AND PROPER PERFORMANCE.


6. How do I setup NT/2K/XP to start the Battlefield 1942 Server as a service?

WARNING! This procedure involves installing some software and manualy editing the registry. NOT for the faint of heart. I take no responsibility if you fubar your computer while mucking in the registry :) Also, I have only done this on XP, the paths and programs are probably different on NT/2000 so please do not ask me how to set it up on those systems.

First, you will need the two small Microsoft programs in order to set up your service. Instsrv.exe is the program used to create a Windows service, and Srvany.exe is a program that allows almost any other program to run as a service. These files are available in Microsoft's Windows Resource Kit, at various internet sites, or you can just download them both here:

http://www.pcisys.net/~pijo/service.zip
Step 1.
Put Instsrv.exe and Srvany.exe in your BF1942 directory.

Step 2.
From the Start button, go to Run, then type cmd. This will open a command window, where you'll need to change to your BF1942 directory by typing
cd C:\Program Files\EA GAMES\Battlefield 1942 Server, then pressing ENTER (your path may be different, substitute your local path for this and all following steps).

Step 3.
Type instsrv BFserver “C:\Program Files\EA GAMES\Battlefield 1942 Server\srvany.exe” and press ENTER. This will create a service called “BFserver”. You can substitute a different service name if you wish. If the process is successful, you'll see the following message:

——————————————- —————————-
CreateService SUCCESS at creating:

BFserver

You must now go to the Registry and the Services applet
in the Control Panel and edit them as per the instructions.
—————————————- ——————————-

Step 4.
Open Regedit by clicking Start->Run, then typing regedit and pressing ENTER.

Step 5.
Navigate to the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Services\BFserver

Step 6.
In the left pane of the registry window, click on the BFserver key. Then, in the right pane, right-click and choose NEW -> KEY. Name the key Parameters

Step 7.
In the newly-created Parameters key, right-click and choose NEW -> STRING VALUE. Name the value AppDirectory

Step 8.
Repeat Step 7 to create a second new string value. Name it AppParameters

Step 9.
Repeat Step 7 to create a third new string value. Name it Application

Step 10.
Double-click on the String Value “AppDirectory”. This will bring up the Modify dialog box. Set the value for AppDirectory to
C:\Program Files\EA GAMES\Battlefield 1942 Server\

Step 10.
Double-click on the String Value “AppParameters”. This will bring up the Modify dialog box. Set the value for AppParameters to
+restart 1 +hostServer 1 +dedicated 1

Step 11.
Double-click on the String Value “Application” Set the value for Application to C:\Program Files\EA GAMES\Battlefield 1942 Server\BF1942.exe

Step 12.
Close Regedit

Step 13.
Open the Services application to modify the service settings (in XP, Start->Settings->Control Panel, Double click Administrative Tools, Double click Services). In Services you should see BFserver, double click on it to open its properties. Set ‘Startup type’ to Automatic then click on the Log On tab. In Log On, check the box that says “Allow service to interact with desktop”.

You can now click back on the ‘General’ tab to test the startup of your server. Click the ‘start’ button and the server should start up.

If it does not, you probably entered something wrong in the registry (path, executable location, etc). Go back through steps 4-12 and make sure eveything is set correctly.

Step 14.
If you are using XP, I highly recommend disabling crash notifications. Right click on ‘My Computer’ and select Properties. Click on the ‘Advanced’ tab then click the ‘Error Reporting’ button at the bottom. Select the ‘Disable error reporting’ option and make sure ‘But notify me when critical errors occur’ is still checked. Click ‘OK’ then ‘OK’ again and that's it!

The newly-created BFserver service should now function as any other system service. If you set it to Automatic, it should always start when the system is booted (and before anyone logs into the system with the rest of the services).

If for any reason you should decide you want to remove the BFserver service, go to Control Panel->Administrative Tools->Services. Right-click on the BFserver service and choose STOP. After the service is stopped, open a command-prompt window, navigate to your BF1942 directory, and type
instsrv BFserver remove. This will completely remove the service from your system. You can still run your BF1942 server as you did before, as a normal application via the shortcut.


7. How do I setup my server behind a firewall?

If you do not care about (or want) the server being listed in Ga*spy, then you only need to open udp port 14567 into your network. If you are behind a firewall/router that is also doing NAT, you will need to port forward udp port 14567 from your firewall/router to your internal server. On some routers you may also make your server a ‘DMZ’ host which effectively puts the server on the outside of the firewall. However, please realize that exposes your server
and all of its potentially open ports (and exploitable code) to the rest of the dirty, public internet :)

You will also need to open/forward TCP port 4711 if you want to use the RemoteConsole admin tool (or whichever custom port you specified when enabling access for the RemoteConsole tool).

If you do want your server to be listed in Ga*spy you will need a crapload of additional ports opened up (who knows why they need all these ports :P. Here are the ports I have open on my router:

# Gamespy
allow udp range 14567 14570
allow udp 22000
allow udp range 23000 23009
# Gamespy Master Server UDP Heartbeat
allow udp port 27900
# Gamespy Master Server List Request
allow tcp port 28900

In addition you may or may not :) need to open the ports listed in the “Working Around the Firewall/Proxy” section of this Ga*spy page:

http://www.gamespyarcade.com/support/firewalls .shtml (thanks to mibsc123 for the link)


8. What do I need to enable in my config for the server to be listed with Gamespy/ASE?

In you ServerSettings.con file make sure the following option is set to 1 (not 0):

game.serverInternet 1


9. Why do I not see my server in Gamespy?

There can be a lot of reasons for this including:
-You are behind a firewall which does not allow GS traffic outside. See question #7
-You do not have the server set to advertise to the master servers. See question #8
-Gamespy is having problems or their software is acting up. Try refreshing/updating
the list of servers in the browser a few times. Sometimes it takes 3 or 4 refreshes for your server to show up. Also, GS frequently has problems with master servers disappearing and removing some but not all game servers from the browser. I suggest trying All Seeing Eye (aka ASE) or directly connecting to the server via IP address.

If you cannot connect to it at all you are probably behind a firewall. If you can connect to it directly via IP but it does not show up in GS or ASE, then you probably have the game.serverInternet directive set to 0. If you cannot see your server in Gamespy but *can* in ASE, then GS is borked and you should tell people to use your IP address or ASE.


10. Are there command line switches that tell the server to start with a specific .con file (such as ServerSettings.con or maplist.con)?

This functionality does not exist at this time. However, it has been suggested and may appear in a future version.


11. Are there reserved slots for admins or users with a ‘reserved’ password?

This functionality does not exist at this time. However, it has been suggested and may appear in a future version.


12. Is it possible to restrict clients by ping?

This functionality does not exist at this time. However, it has been suggested and may appear in a future version. You may restrict which types of connections may connect to your server. See the next question.


13. How do I restrict the client's connection type? What is game.ServerMaxAllowedConnectionType?

In the settings file you will find a directive named game.ServerMaxAllowedConnectionType. This has four options:

CTModem56Kbps, CTCable128Kbps, CTCable256Kbps, and CTLanT1.

You should set it to the speed at which your slowest client will connect, if you want that client to have an acceptable connection. For example, if you will be serving 56k users you should set it to CTModem56kbps. If the slowest user you want on your server uses (dual) ISDN, set it to CTCable128kbps). If you plan on *only* serving good broadband clients (with a minimum of 256 downstream), set it to CTCable256Kbps. You should only use CTLanT1 for LAN games, NEVER for Internet servers (unless *all* of your clients have a FULL T1 circuit or better to your server). Setting the server to CTLanT1 for internet gaming will only flood the client (and intermediary routers) with large packets which will be fragmented and often retransmitted, resulting in pchoppy and poor performance.


14. How do I specify the number of bots and the CPU time given to them for a Co-op server?

In there serversettings.con there should be two directives:
game.serverCoopAiSkill 75
game.serverCoopCpu 20

Increase those as desired. Please remember that the more you increase the CPU time given to the AI, the slower the server will run and the less clients you will be able to support (i.e. you would have to lower your server from a 32 player to a 24, etc.)


15. Will there be a linux version of the dedicated server? When?

There will be a linux dedicated server but it's release date is unknown. Rest assured everyone including the developers and publishers know how important a Linux version of the dedicated server is to the success of the game. The unofficial word is they are working on it diligently and will have it for us a soon as possible (BUT NO ESTIMATED OR OFFICIAL DATE OF RELEASE).

16. Why do I get the following error: ASEHost.dll Error: failed to execute ASEQuery_int!

This is a known bug in version 1.1 of the dedicated server package (not retail) that occurs during server map changes. The cause is still being investigated but it appears to be caused by enabling access for the RemoteConsole tool or on maps which have 3 or more rounds. The current workaround is to run the dedicated server from a full Retail installation (or to limit number of rounds to below 3. I never got this error running 1 round maps on my servers.).



All comments, changes, suggestions, and additions are welcome! Please contact me at the address below or on the CE and BF Community forums - cebf.ws

——————————-
COPYRIGHT 2002 g8@the.whole.net
“Restecp” to the CE and BF Community - http://cebf.ws
Permission is granted to reproduce/repost this FAQ as long as the entire contents and copyright are retained. Please give credit where it's due :)
Original text version if the FAQ always located at http://bf1942.is.no.bs/bf1942-server-admin-faq.txt
— —————————-
Edited by: g8 at: 9/19/02 10:22:52 pm