Deer Hunter 2005 Docker Container
This Docker container runs a Deer Hunter: The 2005 Season dedicated server. It is built on the WINE image and runs the retail game's headless dedicated mode, DH2005.exe -Dedicated_Server:TRUE. The container doesn't download the game, so you provide the files.
Quick Start
services:
deerhunter2005:
image: lancommander/deerhunter2005:latest
container_name: deerhunter2005
ports:
- 23459:23459/udp
- 6073:6073/udp
volumes:
- "/data/Servers/Deer Hunter 2005/Default:/config"
environment:
DH2005_SERVER_NAME: "My Deer Hunter Server"
DH2005_SEASON: "RUT"
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
restart: unless-stopped
Copy a Deer Hunter 2005 v1.2 install (the folder with DH2005.exe, Aspen.dll and Game/) into Server/ before the first start. You can instead set DH2005_ARCHIVE_URL to a zip of that folder.
How It Starts
PostInitialization/10-InitializeWinePrefix.ps1(from the WINE image) creates the Wine prefix in/config/wineprefix.PostInitializeWinePrefix/20-InstallDirectPlay.ps1runswinetricks directplayonce, using the DirectX redist cached in the image. This installs Microsoft'sdpnet.dlland related DLLs. The game needs them: with Wine's builtin DirectPlay 8 it logsCould not init CNetServer DirectPlay media!and quits. A marker file,wineprefix/.lancommander-directplay, records that the install is done. Delete it to reinstall.PostInitialization/20-InstallDeerHunter2005.ps1checks forServer/DH2005.exe. If it's missing andDH2005_ARCHIVE_URLis set, the hook downloads the archive.PostInitialization/30-InstallPatch.ps1installs the modern patch (dinput8.dlland a generateddh2005patch.ini) unlessDH2005_PATCH_ENABLED=false. It sets the player cap, the animal settings and LANCommander match statistics; see the README.START_EXE(/usr/local/bin/dh2005-server) builds the command line from theDH2005_*variables and writes it toC:\dh2005-server.bat. It runs the batch file withwine cmdunder Xvfb, and followsGame/Game.LOGto stdout.
The game parses its own Windows command line (-Server_Name:"My Server"). This is why the command line is written to a batch file and isn't passed through START_ARGS. Use DH2005_EXTRA_ARGS for anything raw. Any START_ARGS are appended too, but quoting inside them is lost.
A successful start ends with:
Hosting a dedicated server multi-player match at "Oregon"...
SERVER: Server network ready...
>>> Multi-player match started - dedicated server.
Configuration Options
Ports
- 23459/udp: Game (DirectPlay host). The game's own help says 23458, but the v1.2 server listens on 23459.
- 6073/udp: DirectPlay enumeration (
dpnsvr), which the in-game LAN search uses
DirectPlay also opens some dynamic UDP ports. Giving the container its own LAN address (macvlan/ipvlan) is the most reliable setup.
Environment Variables
See the README for the full table. The defaults match the game's RunDedicated.bat, except that GameSpy publishing is off.
Hooks
| Hook | When |
|---|---|
PreInstallDeerHunter2005 / PostInstallDeerHunter2005 | Around the game file check/download |
PreInitializeWinePrefix / PostInitializeWinePrefix | Around Wine prefix creation (WINE image) |
Put .ps1 scripts in config/Scripts/Hooks/<HookName>/.