Skip to content

Commit

Permalink
✨ add Punkbuster support (#41)
Browse files Browse the repository at this point in the history
* ✨ add punkbuster libraries

* 📝 update readme for lib, bin and server folders

* 🐳 use pb lib in Dockerfile

* 🔧 reorganized and updated server config file

* 🔧 add pb config file

* 🐳 updated docker-compose server parameters

* 📝 added dev exec script and updated readme

* 📝 updated server doc

* 🔧 decrease timeout on dev-down script

* 💚 exclude tags and some doc from the workflow trigger

* 🚚 rename server config files to fit readme

* 🐳 correct server parameters

* 🔧 allow rcon login by default

* ➕ add newer version au pb libs

* 🐳 update dockerfile to use new pb libs

* 🔥 removed useless pb libs files

* 🐳 disab le punkbuster by default

* ⚗️ testing new action trigger setup
  • Loading branch information
bgauduch committed May 1, 2020
1 parent 39cd6d1 commit 135a291
Show file tree
Hide file tree
Showing 19 changed files with 212 additions and 71 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# include server binaries
!bin/cod2_lnxded*

# include PunkBuster libraries
!lib/pb/*
7 changes: 7 additions & 0 deletions .github/workflows/lint-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: lint-build-push

on:
push:
tags-ignore:
- "**"
branches:
- "**"
pull_request:
branches:
- master
release:
types: [published]

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ ENV SERVER_USER="cod2"
RUN addgroup -S ${SERVER_USER} && adduser -S -D -G ${SERVER_USER} ${SERVER_USER}
USER ${SERVER_USER}

# Copy needed libraries and binaries from build stage
# Copy needed libraries and binaries
COPY --from=build /usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
COPY --from=build /lib/i386-linux-gnu/ /lib/i386-linux-gnu/
COPY --from=build /lib/ld-linux.so.2 /lib/ld-linux.so.2
COPY --from=build /lib/libcod2_${COD2_VERSION}.so /lib/libcod2_${COD2_VERSION}.so
COPY --from=build /bin/cod2_lnxded /home/${SERVER_USER}/cod2_lnxded
COPY lib/pb/v1.760_A1383_C2.208/ /home/${SERVER_USER}/pb/

# Exposed server ports
EXPOSE 20500/udp 20510/udp 28960/tcp 28960/udp
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ This repository use a multi-build setup to provide images for all server binarie
All image tags can be found on the [Docker Hub registry](https://hub.docker.com/r/bgauduch/cod2server/tags).

The following convention is applied:
* `bgauduch/cod2server:latest` - [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/master/Dockerfile)
* uses latest available cracked server binary and libcod library.
* `bgauduch/cod2server:X_Y_zzzzzz`
* where `X_Y` is the server binary and libcod library version in [1_0, 1_2, 1_3];
* where `zzzzzz` is the server binary declination. Report to the [readme in the `/bin` folder](https://github.com/bgauduch/call-of-duty-2-docker-server/tree/master/bin) for explanations.

Please report to the [releases section](https://github.com/bgauduch/call-of-duty-2-docker-server/releases) for the changelogs.
* **`bgauduch/cod2server:latest`** - [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/master/Dockerfile)
* uses latest available cracked server binary and libcod library, build from `master` branch.
* **`bgauduch/cod2server:3.0`** - [Dockerfile](https://github.com/bgauduch/call-of-duty-2-docker-server/blob/3.0/Dockerfile) - equivalent to `latest` on release tag.
* **`bgauduch/cod2server:X_Y_zzzzzz`**
* **`X_Y`** is the server binary and libcod library version in [`1_0`, `1_2`, `1_3`];
* **`zzzzzz`** is the server binary declination. Report to the [readme in the `/bin` folder](https://github.com/bgauduch/call-of-duty-2-docker-server/tree/master/bin) for explanations.

Please report to the [releases section](https://github.com/bgauduch/call-of-duty-2-docker-server/releases) for the changelogs. Any other image tag is not supported.

## 🔧 What's inside
* The `cod2_lnxded` server binary from [Killtube](https://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)) by [Kung Foo Man](https://github.com/kungfooman), [Mitch](https://github.com/M-itch) and anyone that contributed;
Expand Down Expand Up @@ -99,6 +99,12 @@ map_rotate
# Use the escape sequence to detach: `CTRL+P`, `CTRL+Q`
```

### Run a shell in the server container
You can debug directly inside the server container (show file structure, tail logs, etc):
```sh
./scripts/dev-exec.sh
```

### Cleanup
Remove everything once your tests are over:
```sh
Expand Down
11 changes: 6 additions & 5 deletions bin/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Server binary
# Server binaries
You can find here original and cracked server binary files.

## Sources
Expand All @@ -7,9 +7,10 @@ It might be usefull if you want to create a public server to play on without a v

## Usage
Custom server binary naming explanations (credits to **Mitch** on [this thread](https://killtube.org/showthread.php?1719-Latest-cod2-linux-binaries-(1-0-1-2-1-3)) and [this post](https://killtube.org/showthread.php?1337-CoD2-Tutorial-How-to-make-your-cracked-server-show-up-in-the-master-list&p=16844&viewfull=1#post16844)):
- "cracked": disable the master server + "nodelay"
- "nodelay": changes the minimum required master server offline time before you can connect to an original server (from ~30 minutes to 5 seconds)
- "loc": no spam of non-localized strings
- "va": patch for string overrun in call to va() function (more than 1024 chars), can be considered a security patch and should be used
- `1_0a`, `1_2c`, `1_3`: server version for compatibility with your game
- `nodelay`: changes the minimum required master server offline time before you can connect to an original server (from ~30 minutes to 5 seconds)
- `cracked`: disable the master server + "nodelay"
- `loc`: no spam of non-localized strings
- `va`: patch for string overrun in call to va() function (more than 1024 chars), can be considered a security patch and should be used

Use the one that fit your needs.
13 changes: 11 additions & 2 deletions cod2server/main/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# main folder
Location of all the *.iwd game files and server config
# `Main` folder
Location of all the *.iwd game files and server configuration files.

## `.iwd` files
Theses are the game files used by server binaries, they are the same as your client game files.


## Configuration files
Two example configurations files are provided :
* The `server_mp.cfg` regroups all server configurations (gameplay, gametype, weapons, map rotations, etc). You should adapt it to fit your needs;
* The `punkbuster.cfg` regroup configuration specific to PunkBuster when enabled on the server.
7 changes: 7 additions & 0 deletions cod2server/main/punkbuster.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/////////////////////////////////////////////////
// PunkBuster Config file for the cod2 server. //
// IT MUST BE IN THE /main FOLDER ! //
/////////////////////////////////////////////////

// Punkbuster config
set pb_sv_guidrelax "7"
174 changes: 124 additions & 50 deletions cod2server/main/config.cfg → cod2server/main/server_mp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
// IT MUST BE IN THE /main FOLDER ! //
//////////////////////////////////////

// General info
// Note : some vars are write-protected and should be set directly when launching the server binary
// For instance : ./cod2_lnded +set sv_cheats "1"

// list of protected vars:
// set dedicated "2" (0=Listen Server, 1=Dedicated LAN server, 2=Dedicated Internet Server)
// set net_port (default="28960")
// set net_ip xxx.xxx.xxx.xxx (dafault=your host ip)
// set sv_cheats: 0=No, 1=Yes (default="0")
// set fs_homepath "PATH_TO_MAIN"
// set fs_basepath "PATH_TO_MAIN"
// set sv_punkbuster: 0=No, 1=Yes
// set fs_path "PATH_TO_PB_IN_MAIN" (default="pb")

////////////////////////
// Server information //
////////////////////////

// General informations
sets _Admin "YourAdminName"
sets _Email "YourAdminEmail"
sets _Website "YourWebsite"
Expand All @@ -13,97 +30,148 @@ sets _Location "YourCountry"
set sv_hostname "docker powered server"
set scr_motd "Come in peace, leave in pieces"

// Set the Server IP and Port Address
//set net_ip xxx.xxx.xxx.xxx
//set net_port 28960
//////////////////////////
// Server configuration //
//////////////////////////

// Set the Rcon password
// WARNING: CHANGE IT BEFORE LAUNCHING YOUR SERVER
set rcon_password "YOUR_SUPER_SECRET_PASSWORD"

// Private Player slot and password
// WARNING: CHANGE IT BEFORE LAUNCHING YOUR SERVER
set sv_privateclients "0"
set sv_privatepassword "YOUR_PRIVATE_SLOT_PASSWORD"

// enable cracked server mode when using libcod
set sv_cracked 1

// Set the Server Min and Max Ping
set sv_maxPing "250"
set sv_minPing "0"
// Show debug info in the log file
set developer "0"

// Set the Game type: bel, dm, re, sd, tdm
//set g_gametype "dm"
// Pure on or Off: Pure is basicly an anticheat
set sv_pure "1"

// Set the Rcon Password: To control the Server Remotely
set rcon_password "YOUR_SUPER_SECRET_PASSWORD"
// Punkbuster config
pb_sv_guidrelax "7"

// Maximum Players on the Server
set sv_maxclients "20"

// Setup for Private Player spots on the Server
set sv_privateclients "0"
set sv_privatepassword ""

// Set the Max Rate Per Player on the server
// MaxRate = Upload Speed / (# of Players * 8)
set sv_maxrate "25000"

// Pure on or Off: Pure is basicly an anticheat
set sv_pure "1"
// Server FPS: default=20, range=[10,1000], accepted values=(1000/N) where N is in integer (1000, 500, 333, 250, and so on)
set sv_fps "1000"

// Set the Server Min and Max Ping
set sv_maxPing "150"
set sv_minPing "0"

// Antilag feature
set g_antilag "0"

// Disable rcon console access from client in-game
set sv_disableClientConsole "0"

// Disable rcon console access from client
set sv_disableClientConsole "1"
// Server password protection: empty=No password not-empty=password protected
set g_password ""

// Have the Server Show Up on GameSpy
// Enable multiplayer logs: 0=No 1=Yes
set logfile "1"

// Set multiplayer logs synchronisation
// 0 - direct write
// 1 - buffered write
set g_logsync "1"

// Multiplayer log file name (in the fs_homepath directory)
// default "games_mp.log"
set g_log "games_mp.log"

// Have the server show up on GameSpy
set sv_gamespy "1"

// Allow Downloads from the Server (custom mods and maps): 0=No, 1=Yes
set sv_allowdownload "1"

// Limit client download rate and reconnect attempt limit
set sv_dl_maxRate "150000"
set sv_reconnectlimit "3"

// Enabled web download (more reliable than download from your game server)
// You must have an HTTP / FTP server setup at provided URL for this to work
set sv_wwwDownload "0"
set sv_wwwBaseURL "http://example.com/"
// Allow web download without being connected to the server: default=0
// Also prevent from stopping download on map rotation
set sv_wwwDlDisconnected "1"

///////////////////////
// Gameplay settings //
///////////////////////

// Friendly fire: 0=Off 1=On 2=Reflect Damage
set scr_friendlyfire "2"

// Allow Voting on the server: 0=No 1=Yes
// It is recommended if you have friendly fire on
// that you also enable voting so that players can kick team killers
set scr_allow_vote "1"
set g_allowvote "1"
set g_oldvoting "1"

// Friendly Fire: 0=Off 1=On 2=Reflect Damage
set scr_friendlyfire "2"

// Team Kill Options
// Team kill options
set g_teamkillwarn "3"
set g_teamkillkick "3"

// Invulnerable Time After a Respawn
// Invulnerable time after respawn
set sv_invulnerabletime "1"

// Delay in Time Before a Player Can Switch Teams
// Delay in seconds before a player can switch teams
set g_teamswitchdelay "5"

// Force Respawn: DM, TDM
set scr_forcerespawn "1"

// Draws a Team Icon Over Teammates: 0=Off 1=On
set scr_drawfriend "1"
set scr_drawfriend "0"

// 0=Kill Cam 1=Team Spectate
// Spectating: 0=KillCam Cam 1=Team Spectate
set g_forceteamspectate "0"

// Enable Developer it Controls the Type of Log File
set developer "1"

// Allow Downloads from the Server
set sv_allowdownload "1"

// Flood Protect the Server
set sv_floodProtect "1"

// Auto Team Balance
set scr_teamBalance "1"
// Allow killcam: 0=Off, 1=On
set scr_killcam "0"

// Allow Free Spectating
set scr_spectatefree "0"

// Allow Enemy Spectating
set scr_spectateenemy "0"

// Authorize chat when player is dead: 0=Off, 1=On
set g_deadChat "1"

// Flood Protect the server chat
set sv_floodProtect "1"

// Auto Team balance: 0=Off, 1=On
set scr_teamBalance "1"

// Allow Voice Communications
set sv_voice "0"
set sv_voice "1"

// Voice Quality
// from 1 to 9, 1 is the lowest
set sv_voicequality "5"

// Voice Quality
set sv_voicequality ""
//////////////////////
// Weapons Settings //
//////////////////////
// 0=Not Allowed, 1=allowed

// Weapons Allowed 1=allow
// American Weapons
// ----------------
// Bar
set scr_allow_bar "1"
// Grease Gun
Expand All @@ -116,8 +184,8 @@ set scr_allow_m1garand "1"
set scr_allow_springfield "1"
// Thompson
set scr_allow_thompson "1"

// Russian Weapons
// ----------------
// Nagant
set scr_allow_nagant "1"
// Nagant Sniper
Expand All @@ -128,8 +196,8 @@ set scr_allow_pps42 "1"
set scr_allow_ppsh "1"
// Tokarev SVT 40
set scr_allow_svt40 "1"

// British Weapons
// ----------------
// Bren
set scr_allow_bren "1"
// Enfield
Expand All @@ -138,8 +206,8 @@ set scr_allow_enfield "1"
set scr_allow_enfieldsniper "1"
// Sten
set scr_allow_sten "1"

// German Weapons
// ----------------
// Gewehr 43
set scr_allow_g43 "1"
// Kar 98k
Expand All @@ -150,16 +218,18 @@ set scr_allow_kar98ksniper "1"
set scr_allow_mp44 "1"
// MP 40
set scr_allow_mp40 "1"

// Common Weapons
// ----------------
// M1897 Trench Gun - Shotgun
set scr_allow_shotgun "1"
// Fragg Grenades
set scr_allow_fraggrenades "1"
// Smoke Grenades
set scr_allow_smokegrenades "1"

// Set the Different Gametype Settings
///////////////////////
// Gametype Settings //
///////////////////////

// Capture the Flag
set scr_ctf_scorelimit "5"
Expand All @@ -185,8 +255,12 @@ set scr_sd_bombtimer "60"
set scr_tdm_scorelimit "100"
set scr_tdm_timelimit "15"

////////////////////////////////
// Map rotation configuration //
////////////////////////////////

// Set the map rotation and gametype
set sv_maprotation "gametype tdm map mp_brecourt gametype ctf map mp_carentan gametype tdm map mp_farmhouse gametype ctf map mp_dawnville gametype tdm map mp_burgundy gametype ctf map mp_trainstation gametype tdm map mp_decoy gametype ctf map mp_toujane gametype tdm map mp_matmata gametype ctf map mp_railyard gametype tdm map mp_breakout gametype ctf map mp_leningrad gametype tdm map mp_downtown"

/ Rotate to launch the first map
// Run map rotation
map_rotate
Loading

0 comments on commit 135a291

Please sign in to comment.