Code Monkey home page Code Monkey logo

bfbc2-server's Introduction

Docker-Images for Battlefield: Bad Company 2 LAN-Server

Many thanks to the battlefieldbadcompany2mase project by flyer8472 for the great project, which enabled me to build these Docker-Images in the first place.

This projects contains two docker-images:

  • The master-server Docker Repository on Quay which is needed by the client to handle the user-account and manages the server-list
  • The game-server Docker Repository on Quay which the clients can connect to for gaming

With this both images you are able to run your own Battlefield Bad Company 2 LAN-Server.

Quick-Start

The easiest way to start your own BFBC2 LAN-Server is to use docker-compose and run it with

docker-compose up -d

this command will start up both servers with default configurations.

alternatively you can run the docker-images manually:

# master-server
docker run \
    -d --net=host \
    quay.io/docker-gameserver/bfbc2-master-server

# game-server
docker run \
    -d --net=host \
    quay.io/docker-gameserver/bfbc2-server

Connecting to your LAN-Server

To be able to connect to your bfbc2-server you have to add the two files bfbc2.ini and dinput8.dll to your installed game-root-folder. This files are included in the Bc2emu_V09.rar (download) inside of the "Crack - Copy to client root"-directory. Edit the line host=127.0.0.1 in the bfbc2.ini and fill in the ip of your server.

In the game simply create a new account with dummy-data (the account data are saved in plain-text in the database-directory mounted to the master-server...)

Inside of the Bc2emu_V09.rar file is also included a readme.txt for detailed instructions.

Master-Server

If you start the server without a database-volume the registered accounts are non-persistent and have to be recreated every time the container is recreated.

To enable persistence you have to create a local database folder and mount it to the docker-container (this is enabled by default in the docker-compose.yaml):

mkdir ./database
docker run \
    -d --net=host \
    -v "./database:/home/bfbc2/database" \
    quay.io/docker-gameserver/bfbc2-master-server

You can overwrite the config.ini with your own by adding a custom config.ini as volume:

docker run \
    --rm -ti --host=net \
    -v ./database:/home/bfbc2/database \
    -v ./config.ini:/home/bfbc2/config.ini \
    quay.io/docker-gameserver/bfbc2-master-server

or edit the docker-compose.yaml and uncomment the - "./custom-config.ini:/home/bfbc2/config.ini" line.

Game-Server

Environment

Variable Description Default
MASTER_SERVER the host to the master-server 127.0.0.1
SERVER_TYPE the game mode of the server. One of rush, conq, sqdm, sqrush, vietconq, vietrush, vietsqrush or vietsqdm rush
SERVER_NAME the name of the server listed in the serverlist BFBC2 Server
SERVER_PORT the port of the server 19567
SERVER_ADMIN_PORT the port for the remote admin-tool 48888
SERVER_ADMIN_PASSWORD the admin password langaming
SERVER_MAX_PLAYERS the maximum amount of connectable players 16
SERVER_HARDCORE set the hardcore mode false
SERVER_FF set friendly fire false
SERVER_TEAMBALANCE set teambalance true
SERVER_KILLCAM show killcam true
SERVER_MINIMAP show minimap true
SERVER_CROSSHAIR show crosshair true
SERVER_SPOTTING show spotting true
SERVER_MINIMAP_SPOTTING show minimap spotting true

Maplists

The default maplists can be overwritten by mounting your own maplist to /home/bfbc2/server/maplists/<gamemode>.txt

docker run \
    --rm -ti \
    -v "./custom_rushmaplist.txt:/home/bfbc2/server/maplists/rush.txt" \
    quay.io/docker-gameserver/bfbc2-server

Build

Naturally you do not have to use the pre-build images from docker-hub. Simply build your own images:

docker build -t bfbc2-master-server ./master-server
docker build -t bfbc2-server ./game-server

Known issues / Todos

host-networking

Currently the docker-containers are startet in host-networking mode. Until now I was not able to run the containers with simple port-mappings. Neither the registration on the master server can be completed, nor can the game servers be found.

I am grateful for further tips

Administration

The remote administration via the SERVER_ADMIN_PORT / SERVER_ADMIN_PASSWORD is currently untested. Feel free to add further instructions to the readme ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.