All Projects → qdm12 → cod4-docker

qdm12 / cod4-docker

Licence: MIT license
Runs a Call of duty 4 Modern Warfare (cod4x) dedicated server in a Docker container.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to cod4-docker

Robot blockly
A simple way to program ROS robots using blockly.
Stars: ✭ 115 (+161.36%)
Mutual labels:  scratch
RaspberryPiMinecraft
Configuration files and performance testing scripts to setup and optimize a dedicated Minecraft (PC Java version) server
Stars: ✭ 179 (+306.82%)
Mutual labels:  dedicated-server
valheim-k8s
valheim game-server on kubernetes
Stars: ✭ 74 (+68.18%)
Mutual labels:  dedicated-server
Pixie
Unofficial rewrite of Scratch in JavaScript.
Stars: ✭ 123 (+179.55%)
Mutual labels:  scratch
Phosphorus
JavaScript compiler for Scratch projects.
Stars: ✭ 250 (+468.18%)
Mutual labels:  scratch
Steam-Server-Manager
PowerShell Steam Server Manager
Stars: ✭ 33 (-25%)
Mutual labels:  dedicated-server
Jxscratchview
一个万能的刮刮乐控件。无论是UILabel、UIImageView,还是自定义视图,只要是UIView都可以用来刮。代码简单,功能强大,你值得拥有!
Stars: ✭ 100 (+127.27%)
Mutual labels:  scratch
PerpetuumServer
Perpetuum Standalone Server
Stars: ✭ 45 (+2.27%)
Mutual labels:  dedicated-server
botman
A Lua server manager for 7 Days to Die powered by Mudlet
Stars: ✭ 29 (-34.09%)
Mutual labels:  dedicated-server
eXpansion
eXpand your Manialive server controller to the new hights
Stars: ✭ 19 (-56.82%)
Mutual labels:  dedicated-server
Scratchaddons
All-in-one browser extension for Scratch.
Stars: ✭ 133 (+202.27%)
Mutual labels:  scratch
Blocklike
Bridging the gap between block programming and JavaScript.
Stars: ✭ 177 (+302.27%)
Mutual labels:  scratch
MySB
MySB (MySeedBox) is more than a simplified installation script of a multi-users Seedbox. There are many solutions to install a Seedbox, but we never talk about safety and regular operations. MySB could be renamed MySSB (MySecuredSeedBox).
Stars: ✭ 105 (+138.64%)
Mutual labels:  dedicated-server
Codelab adapter extensions
codelab_adapter extensions
Stars: ✭ 120 (+172.73%)
Mutual labels:  scratch
UE4-DedicatedServer
A UE4 plugin which adds proper console support (input) and RCon
Stars: ✭ 40 (-9.09%)
Mutual labels:  dedicated-server
Snap4arduino
Binding Snap! and Arduino together
Stars: ✭ 107 (+143.18%)
Mutual labels:  scratch
northstar-dedicated
Docker image for the Northstar dedicated server.
Stars: ✭ 89 (+102.27%)
Mutual labels:  dedicated-server
web-app-from-scratch
Supporting material for my blog post series on writing a web application from scratch in Python.
Stars: ✭ 128 (+190.91%)
Mutual labels:  scratch
serverthrall
Conan Exiles Dedicated Server Manager
Stars: ✭ 26 (-40.91%)
Mutual labels:  dedicated-server
minecraft-pi-reborn
Official Mirror Of @TheBrokenRail's Minecraft: Pi Edition: Reborn.
Stars: ✭ 133 (+202.27%)
Mutual labels:  dedicated-server

COD4 Docker dedicated server

Call of duty 4 dedicated server in a 125MB Docker image.

Docker Cod4

Build status Docker Pulls Docker Stars

GitHub last commit GitHub commit activity GitHub issues

Join Slack channel

Donate PayPal

Requirements

  • COD4 Client game
  • COD4 running on version 1.7 have to update to 1.8-20.1
  • Original COD4 main and zone files required (from the client installation directory)

Features

  • Cod4x server features
  • Works with custom mods and maps (see the Mods section)
  • Built-in HTTP file server for usermaps and mods (only works with .ff and .iwd files for security reasons)
  • Runs without root (safer)
  • Default cod4 configuration file server.cfg when not using mods, with exec server.cfg
  • Works with the cod4x masterlist
  • Cod4x server built from source
  • Other Cod4x files server downloaded from cod4x.me
  • Auto updates to the latest cod4x release
  • Only 125MB
  • See more Docker image tags: Docker Hub tags

Setup

We assume your call of duty 4 game is installed at /mycod4path

  1. On your host, create the directories ./main, ./zone, ./mods and ./usermaps.

  2. From your Call of Duty 4 installation directory:

    • Copy all the .iwd files from /mycod4path/main to ./main
    • Copy all the files from /mycod4path/zone to ./zone
    • (Optional) Copy the mods you want to use from /mycod4path/mods to ./mods
    • (Optional) Copy the maps you want to use from /mycod4path/usermaps to ./usermaps
  3. As the container runs as user ID 1000 by default, fix the ownership and permissions:

    chown -R 1000 main mods usermaps zone
    chmod -R 700 main mods usermaps zone

    You can also run the container with --user="root" (unadvised!) if this doesn't work, or build the image with --build-arg UID=yourid.

  4. Run the following command as root user on your host:

    docker run -d --name=cod4 -p 28960:28960/tcp -p 28960:28960/udp -p 8000:8000/tcp \
        -v /mycod4path/main:/home/user/cod4/main \
        -v /mycod4path/zone:/home/user/cod4/zone \
        -v /mycod4path/mods:/home/user/cod4/mods \
        -v /mycod4path/usermaps:/home/user/cod4/usermaps:ro \
        qmcgaw/cod4 +map mp_shipment

    The command line argument +map mp_shipment is optional and defaults to +set dedicated 2+set sv_cheats "1"+set sv_maxclients "64"+exec server.cfg+map_rotate

    You can also download and modify the docker-compose.yml file and run

    docker-compose up -d

HTTP server for custom mods and maps

By default, the container runs with an HTTP file server for mods and usermaps on port 8000.

  • You can disable it with -e HTTP_SERVER=off
  • You can change its published port with for example -p 9000:8000/tcp
  • You can change its root URL with for example -e ROOT_URL=/cod4. This is useful if you use a reverse proxy.
  1. Locate the relevant cod4 configuration file - for example main/server.cfg or mods/mymod/server.cfg

  2. Modify/add the following lines & change youraddress to your IP or domain name:

    set sv_allowdownload "1"
    set sv_wwwDownload "1"
    set sv_wwwBaseURL "http://youraddress:8000" // supports http, https and ftp addresses
    set sv_wwwDlDisconnected "0"
  3. Feel free to open an issue for help setting this up, such as port forwarding or reverse proxy setup help

Update your game

  1. Make sure you updated your game to version 1.7 first (see this)
  2. Download the COD4x client ZIP file
  3. Using Winrar / 7Zip / Winzip, extract cod4x_client_20_1.zip to your COD4 game directory
  4. Go in the extracted directory cod4-client-manualinstall_20.1 and double click on install.cmd
  5. When launching the multiplayer game, you should see at the bottom right 20.1

Testing

  1. Make sure you updated your COD4 Game to 1.8-19.0
  2. Launch the COD4 multiplayer game
  3. Click on Join Game
  4. Click on Source at the top until it's set on Favourites
  5. Click on New Favourite on the top right
  6. Enter your host LAN IP Address (i.e. 192.168.1.26)
    • Add the port if you run it on something else than port UDP 28960 (i.e. 192.168.1.26:28961)
  7. Click on Refresh and try to connect to the server in the list

COD4 screenshot

Mods

Assuming:

  • Your mod directory is ./mymod
  • Your main mod configuration file is ./mymod/server.cfg

Set the command line option to +set dedicated 2+set sv_cheats "1"+set sv_maxclients "64"+set fs_game mods/mymod+exec server.cfg +map_rotate

Write protected args

The following parameters are write protected and can't be placed in the server configuration file, and must be in the command passed to the container:

  • +set dedicated 2 - 2: open to internet, 1: LAN, 0: localhost
  • +set sv_cheats "1" - 1 to allow cheats, 0 otherwise
  • +set sv_maxclients "64" - number of maximum clients
  • +exec server.cfg if using a configuration file
  • +set fs_game mods/mymod if using a custom mod
  • +set com_hunkMegs "512" don't use if not needed
  • +set net_ip 127.0.0.1 don't use if not needed
  • +set net_port 28961 don't use if not needed
  • +map_rotate OR i.e. +map mp_shipment should be the last launch argument

By default, the Docker image uses this command.

TODOs

  • UDP proxy for Windows
  • Reload ability of cod4x
  • Docker Healthcheck + HTTP healthcheck endpoint (i.e. for K8s)
  • Add extra ping with udp proxy
  • More env variables
    • Plugins
  • Plugins
  • Built-in mods?

Acknowledgements

  • Credits to the developers of Cod4x server
  • The help I had on Cod4x.me forums
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].