diff --git a/README.md b/README.md index 1d0a6a0..320ed43 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,13 @@ The easiest way to start your own BFBC2 LAN-Server is to use [docker-compose](ht docker-compose up -d ``` -this command will start up both servers with default configurations. +this command will start up the master-server and two game-servers (ruah and sqdm) with default configurations. alternatively you can run the docker-images manually: ```sh # master-server -docker run \ +docker run -t \ -d --net=host \ quay.io/docker-gameserver/bfbc2-master-server @@ -49,7 +49,7 @@ To enable persistence you have to create a local database folder and mount it to ```sh mkdir ./database -docker run \ +docker run -t \ -d --net=host \ -v "./database:/home/bfbc2/database" \ quay.io/docker-gameserver/bfbc2-master-server @@ -100,6 +100,10 @@ docker run \ quay.io/docker-gameserver/bfbc2-server ``` +## Multiple Game-Server + +make sure that you have unique `SERVER_PORT` and `SERVER_ADMIN_PORT` env variables set per server instance. + # Build Naturally you do not have to use the pre-build images from docker-hub. Simply build your own images: diff --git a/docker-compose.yaml b/docker-compose.yaml index 8ecb898..da60256 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,17 +2,20 @@ version: "3" services: - bfbc2-master-server: + master-server: image: quay.io/docker-gameserver/bfbc2-master-server - # build: ./master-server + #build: ./master-server + restart: always network_mode: "host" + tty: true # for real-time output volumes: - "./database:/home/bfbc2/database" # - "./custom-config.ini:/home/bfbc2/config.ini" - bfbc2-server: + rush-server: image: quay.io/docker-gameserver/bfbc2-server - # build: ./game-server + #build: ./game-server + restart: always network_mode: "host" environment: MASTER_SERVER: "127.0.0.1" @@ -22,3 +25,18 @@ services: SERVER_ADMIN_PORT: 48888 SERVER_ADMIN_PASSWORD: "langaming" SERVER_MAX_PLAYERS: 8 + + sqdm-server: + image: quay.io/docker-gameserver/bfbc2-server + #build: ./game-server + restart: always + network_mode: "host" + environment: + MASTER_SERVER: "127.0.0.1" + SERVER_TYPE: "sqdm" + SERVER_NAME: "SQDM LAN-Server" + SERVER_PORT: 19568 + SERVER_ADMIN_PORT: 48889 + SERVER_ADMIN_PASSWORD: "langaming" + SERVER_MAX_PLAYERS: 8 + diff --git a/game-server/Dockerfile b/game-server/Dockerfile index 9e5ca16..aa71fb6 100644 --- a/game-server/Dockerfile +++ b/game-server/Dockerfile @@ -23,8 +23,8 @@ USER bfbc2 ENV WINEARCH=win32 \ WINEPREFIX="/home/bfbc2/.wine32" -RUN wineboot \ - && xvfb-run winetricks -q \ +RUN xvfb-run -e /dev/stdout -a -s "-nolisten tcp -screen 0 1280x1024x24" wineboot \ + && xvfb-run -e /dev/stdout -a -s "-nolisten tcp -screen 0 1280x1024x24" winetricks -q \ dinput8 \ vcrun2005 \ vcrun2008 \ diff --git a/game-server/bin/run.sh b/game-server/bin/run.sh index 96467d9..189dcb0 100644 --- a/game-server/bin/run.sh +++ b/game-server/bin/run.sh @@ -8,7 +8,7 @@ cat <bfbc2.ini host=${MASTER_SERVER} connect_to_retail=0 executable_type=auto -show_console=0 +show_console=1 [client] reroute_http=0 @@ -56,16 +56,15 @@ function start_bfbc2_server() { write_config "${SERVER_PATH}" echo "Starting ${SERVER_MODE} server ..." + rm -f "${SERVER_PATH}maplist.txt" ln -s "/home/bfbc2/server/maplists/${MAPLIST_PATH}" "${SERVER_PATH}maplist.txt" - sleep 1 - - xvfb-run wine "Frost.Game.Main_Win32_Final.exe" \ + xvfb-run -e /dev/stdout -a -s "-nolisten tcp -screen 0 1280x1024x24" wine "Frost.Game.Main_Win32_Final.exe" \ -serverInstancePath "${SERVER_PATH}" \ -mapPack2Enabled 1 \ -timeStampLogNames \ -region OC \ - -heartBeatInterval 20000 + -heartBeatInterval 20000 } shopt -s nocasematch