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
    Code:
    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.
    Code:
    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
    Introduction
    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.

    http://i.imgur.com/YubTsH4.pngServer requirements
    According to EA, these are the minimum requirements for a Linux dedicated server:
    Quote:
    CPU: 1 Ghz
    RAM: 256 Mb

    Recommended Specification, based on playing a 64 player game:
    Quote:
    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.

    http://i.imgur.com/qqsW2jp.pngWhy 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.

    http://i.imgur.com/2tA48QQ.pngSSH connection

    http://i.imgur.com/z6QR8ZA.png

    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):

    http://www.putty.org/

    http://i.imgur.com/SKhOJup.pngInstallation

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

    http://i.imgur.com/Kdc3v2m.png

    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!

    http://i.imgur.com/ysbwMTS.pngadduser bf2

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

    http://i.imgur.com/ysbwMTS.pngmkdir /home/bf2

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

    http://i.imgur.com/ysbwMTS.pngpasswd bf2

    2) Set the new user as owner of the home dir:

    http://i.imgur.com/ysbwMTS.pngchown -R bf2 /home/bf2

    3) Login new user:

    http://i.imgur.com/ysbwMTS.pnglogout

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

    http://i.imgur.com/ysbwMTS.pngcd /home/bf2

    4) Get the server files:

    http://i.imgur.com/ysbwMTS.pngwget http://download.bf2.us/servers/bf2.linux.server.tar.gz

    5) Extract downloaded file:

    http://i.imgur.com/ysbwMTS.pngtar -xvzf bf2.linux.server.tar.gz

    Note: For more info about tar type:

    http://i.imgur.com/ysbwMTS.pngtar man

    6) Make the launcher executable:

    http://i.imgur.com/ysbwMTS.pngchmod u+x server/bf2/start.sh

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

    http://i.imgur.com/ysbwMTS.pngcd server/bf2

    See the content:

    http://i.imgur.com/ysbwMTS.pngls

    And start the configuration!

    http://i.imgur.com/609wKRX.pngConfiguration

    1) Change into your BF2 installation directory and edit the server config file:

    http://i.imgur.com/ysbwMTS.pngnano -w mods/bf2/settings/serversettings.con

    Note: These are the most important settings

    Quote:
    #serversettings.con
    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 "192.168.1.1" // 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 "192.168.1.1" // IP of your server


    2) Edit your maplist to contain the maps you want to have in your map cycle:

    http://i.imgur.com/ysbwMTS.pngnano -w mods/bf2/settings/maplist.con

    Note: Here's an example:

    Quote:
    #maplist.con
    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 default.py in admin:

    http://i.imgur.com/ysbwMTS.pngnano –w admin/default.py

    Note: Be sure to save your password somewhere:

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


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

    http://i.imgur.com/ysbwMTS.pngnano –w unlock.py

    Note: Edit 0 value to 1 to unlock.

    http://i.imgur.com/1Dp0E5M.pngRunning 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:

    http://i.imgur.com/ysbwMTS.pngcd server/bf2/

    3) To view the different starting parameters:

    http://i.imgur.com/ysbwMTS.png./start.sh +help

    4) Starting the server:

    http://i.imgur.com/ysbwMTS.png./start.sh +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