Help - Battlefield 2 Server - Linux

Santiago

Active Member
May 9, 2015
19
16
81
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.
Exemple Hex':
Hex - Dec
40 = 64
80 = 128
C0 = 192
FF = 255
..

BF2 version 1.0 - Linux - from "bin/amd-64/bf2_f"
Offset: 6164D

BF2 version 1.0 - Linux - from "bin/ia-32/bf2_f"
Offset: 69644

BF2 version 1.0 - Windows - from "bf2_w32ded.exe"
Offset: 1CFEC

BF2 version 1.0 Demo - Windows - from "bf2_w32ded.exe"
Offset: 1CECC

BF2 version 1.5 - Linux - from "bin/ia-32/bf2"
Offset: 73794

BF2 version 1.5 - Linux - from "bin/amd-64/bf2"
Offset: (18DBC, but not worked)

BF2 version 1.5 - Windows - from "bf2_w32ded.exe"
Offset: 2514C
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.
If anyone can help, I'll be grateful.
 

azayoub

New Member
Jul 29, 2017
1
0
13
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.

YubTsH4.png
Server 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.

qqsW2jp.png
Why 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.

2tA48QQ.png
SSH connection

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/

SKhOJup.png
Installation

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

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!

ysbwMTS.png
adduser bf2

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

ysbwMTS.png
mkdir /home/bf2

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

ysbwMTS.png
passwd bf2

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

ysbwMTS.png
chown -R bf2 /home/bf2

3) Login new user:

ysbwMTS.png
logout

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

ysbwMTS.png
cd /home/bf2

4) Get the server files:

ysbwMTS.png
wget http://download.bf2.us/servers/bf2.linux.server.tar.gz

5) Extract downloaded file:

ysbwMTS.png
tar -xvzf bf2.linux.server.tar.gz

Note: For more info about tar type:

ysbwMTS.png
tar man

6) Make the launcher executable:

ysbwMTS.png
chmod u+x server/bf2/start.sh

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

ysbwMTS.png
cd server/bf2

See the content:

ysbwMTS.png
ls

And start the configuration!

609wKRX.png
Configuration

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

ysbwMTS.png
nano -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:

ysbwMTS.png
nano -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:

ysbwMTS.png
nano –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:

ysbwMTS.png
nano –w unlock.py

Note: Edit 0 value to 1 to unlock.

1Dp0E5M.png
Running 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:

ysbwMTS.png
cd server/bf2/

3) To view the different starting parameters:

ysbwMTS.png
./start.sh +help

4) Starting the server:

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.
 

NNE

C++ priest
VIP
Jul 20, 2016
21
15
78
What reason to edit it in the binary if this value can be set from config file?
 
Top