Question Help - Battlefield 2 Server - Linux

Discussion in 'Programming' started by Santiago, Apr 9, 2017.

  1. Santiago

    Santiago New Member

    Hello, I'm running a dedicated Battlefield 2 server, someone could edit the server executable?
    How do I find the offset to hex edit?
    It is necessary to edit
    sv.numPlayersNeededToStart 1 
    When I start a ranked match, the server does not start until 8 players are online. The ideal would be 1 or 2.
    I know it's possible to edit because I've seen other things like the maximum number of server slots. :)
    Example of maximum number of slots editing.
    g.numPlayersNeededToStart......"A..-r..9S. !V.0%S...U..Vc...T...A.0.U...T...A...A...A...A.0.A.P.A.`.A.p.A...A...A..VE..,M..-M...r.0-M...r...H...A.`.Q...K...r...g.notEnoughPlayersRestartDelay.
    I leave here the linux server file.
    You need to register to view spoilers!
    You need to register to view spoilers!
    If anyone can help, I'll be grateful.
  2. azayoub

    azayoub New Member

    change config
    This guide will cover installing, and configuring a dedicated Battlefield 2 server on GNU/Linux. You can do this in localhost or, as in my case, using a VPS; the only restriction is on the OS, which must be based on Unix. You don’t need excellent technical knowledge, but for a complex configuration of the server, I suggest you to pay attention and learn some Unix base before proceeding. requirements
    According to EA, these are the minimum requirements for a Linux dedicated server:
    CPU: 1 Ghz
    RAM: 256 Mb

    Recommended Specification, based on playing a 64 player game:
    CPU: 3 Ghz. For AMD Athlon 64 CPU: 3500+ (2.2 Ghz)
    RAM: 2 Gb

    It is reported that a full 64player server requires 8Mb/s of bandwidth. use a VPS?
    A VPS is a compromise between a localhost solution and an expensive online pre-configured dedicated server. With a Virtual Private Server, you can have: big bandwidth, 24/7 uptime, no hardware maintenance, power saving… all for a small monthly charge. Here is a list of some of the Cloud Computing provider I've tried and they deserve to be tried.

    - A2 Hosting
    - Amazon EC2
    - AtlanticNet
    - Bandwagon Host
    - BudgetVM
    - DigitalOcean
    - Dreamhost
    - Google Compute Engine
    - Linode
    - Microsoft Azure
    - OVH
    - Ramnode
    - Scaleway
    - StableHost
    - VpsNet
    - Vpsdime
    - Vultr

    For this guide I have chosen the famous DigitalOcean services for their distributed datacenter and for affordable costs, but to be honest I think that Scaleway is the best choice for a game server. For ONLY 3€/m (3.4 $/m) you could have 4 Cores, 2 Gb RAM and 200Mbit/s Internet bandwidth, 1Gbit/s Internal bandwidth. They are the first to provide bare metal services in the cloud computing sector with dedicated servers backed by SSD on ARM architecture. connection

    Once you have chosen the service to use you just have to start your virtual machine and access it through SSH. You can use Putty as a client and PuTTYgen for SSH key management. You can download these software from the official site (it's no installation required):

    Once connected to the server, we can finally start our installation.

    As you can see I used Ubuntu 14.04.4 LTS (Trusty Tahr) x64, but you can choose any other distribution.

    1) Create a new user under which the game server will run.
    It is highly recommended not to run the server as root! bf2

    Note: In some distributions you must create the new user's home using: /home/bf2

    If you enter the wrong password or want to change it: bf2

    2) Set the new user as owner of the home dir: -R bf2 /home/bf2

    3) Login new user:

    Note: Once authenticated we will be in /home/bf2, if not: /home/bf2

    4) Get the server files:

    5) Extract downloaded file: -xvzf bf2.linux.server.tar.gz

    Note: For more info about tar type: man

    6) Make the launcher executable: u+x server/bf2/

    7) Now you have everything you need to start a new server, but before navigate to the dir: server/bf2

    See the content:

    And start the configuration!

    1) Change into your BF2 installation directory and edit the server config file: -w mods/bf2/settings/serversettings.con

    Note: These are the most important settings

    sv.serverName "BF2 Server" // Name of your BF2-Server
    sv.welcomeMessage "text line 1 | text line 2 | [...]" // Server welcome message
    // Use '|' for a linebreak
    sv.password "" // Password needed for players to join the server
    sv.internet 0 // 0 = LAN server, 1 = internet server
    sv.serverIP "" // IP of your server
    sv.serverPort 16567 // Port of your server
    sv.punkBuster 1 // 0 = disable Punkbuster, 1 = enable Punkbuster
    sv.maxPlayers 32 // Maximum number of allowed players (16, 32, 64)
    sv.numPlayersNeededToStart 10 // For ranked servers, this needs to be:
    // 6 for maxPlayers 16, 10 for 32, 10 for 64
    sv.roundsPerMap 2 // How often each map will be replayed
    sv.friendlyFire 100 // For ranked servers: FF on and at 100% damage
    sv.friendlyFireWithMines 1 // Same as above
    sv.tkPunishEnabled 1 // For ranked servers, you need FF-punish on
    sv.interfaceIP "" // IP of your server

    2) Edit your maplist to contain the maps you want to have in your map cycle: -w mods/bf2/settings/maplist.con

    Note: Here's an example:

    mapList.append dalian_plant gpm_cq 32
    mapList.append daqing_oilfields gpm_cq 32
    mapList.append dragon_valley gpm_cq 32
    mapList.append fushe_pass gpm_cq 32
    mapList.append gulf_of_oman gpm_cq 32
    mapList.append kubra_dam gpm_cq 32
    mapList.append mashtuur_city gpm_cq 32
    mapList.append operation_clean_sweep gpm_cq 32
    mapList.append sharqi_peninsula gpm_cq 32
    mapList.append songhua_stalemate gpm_cq 32
    mapList.append strike_at_karkand gpm_cq 32
    mapList.append zatar_wetlands gpm_cq 32

    3) Enable rcon editing in admin: –w admin/

    Note: Be sure to save your password somewhere:

    'port': '4711',
    'password': 'mypassword',

    4) For manage unlocks (ex. weapons) navigate to /server/bf2/python/bf2/stats and: –w

    Note: Edit 0 value to 1 to unlock. the server

    1) I highly recommend not starting the server as root,
    so logout and login as we already seen before with bf2 user.

    2) Navigate to server folder: server/bf2/

    3) To view the different starting parameters: +help

    4) Starting the server: +dedicated +lowPriority

    Note: It is a good idea to start the game using screen, because the server keeps a command line open.

    5) If you are not using rcon, you can directly input your admin command via command line.
    Search on Google for a complete list of command.

    Note: For kill the server process use Ctrl+c as usual.
  3. Santiago

    Santiago New Member

    Thanks, but I wanted to edit the server executable!

Share This Page