Windows version: host the server from your own PC

setup.cmd installs the same DM/GunGame server natively on Windows 10/11
(no Docker or Python) into Documents\cs16, then helps set up how friends
join (LAN, playit.gg, port forwarding, VPN). cs.cmd is the menu.

Also: setup falls back to backup copies of the freely licensed mod
downloads on this Gitea when a main site is down (tools/make-mirror.sh
fills them), and the README is rewritten as a plain guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
esefandClaude Opus 5.5 committed 2026-10-15 20:55:00 +03:00
1 parent 7e9cbee14d
commit 4b7fdcaa23
16 files changed
+1412 -72

No files matched your search

+33
View File
@@ -83,3 +83,36 @@ GunGame settings (`configs/gungame.cfg`):
## Kill counter
`./kills` counts the `"X<..>" killed "Y<..>" with "weapon"` lines in `hlds/cstrike/logs/*.log`, keeping the counts per log file in `kills-tally.json`. Because the counts live in that file, the totals survive the 30-day log cleanup.
## Windows version (`setup.cmd`, `windows/`)
The same stack, native instead of Docker: the win32 builds of every part, `hlds.exe` instead of `hlds_linux`. The Windows scripts are Windows PowerShell 5.1 (built into Windows 10 and 11) and mirror the Linux ones: `windows/setup.ps1` = `setup.sh`, `windows/install.ps1` = `tools/install-addons.sh`, `Start-CsServer` in `windows/common.ps1` = `tools/start.sh`, `windows/cs.ps1` = `cs` + `rcon` + `kills`. They read the same `cstrike/`, `plugins/`, `defaults/` and `tools/versions.txt`; `tools/versions-windows.txt` swaps in the Windows builds of AMX Mod X and YaPB (files with `-linux` in the name are skipped). Settings go in `settings.txt` with the `.env` names.
Things that differ from Linux:
- **Steam installed on the same PC.** The server's `steam_api.dll` finds the Steam client's `steamclient.dll` through `HKCU\Software\Valve\Steam\ActiveProcess\SteamClientDll` and loads that instead of its own, which ends in "Unable to initialize Steam". `Start-CsServer` renames that value until the server answers queries (a few seconds), then puts it back. Steam rewrites it at every start anyway, and every script repairs it on load if a start was interrupted.
- **Firewall.** Setup adds an allow rule for `hlds\hlds.exe` on all network types (admin prompt) before the first start, so Windows' own popup doesn't appear, and removes block rules Windows made if that popup was ever cancelled. Normal users often can't read firewall rules, so the result is remembered in `secrets\firewall-rule.txt`.
- **Install folder.** `Documents\cs16`, or `%USERPROFILE%\cs16` when Documents is synced by OneDrive, or `C:\cs16` when the user folder has non-ASCII characters (SteamCMD and HLDS can't handle them). The folder is remembered in `%LOCALAPPDATA%\cs16-dm-server\install-folder.txt`, so running a newly downloaded `setup.cmd` updates the existing install.
- **Console log.** `-condebug` writes `hlds\qconsole.log`; setup shows its end when the server doesn't come up.
- **No watchdog or backups.** It's meant to be started and closed like a game.
Tests for the pure functions: `Invoke-Pester windows\tests` (Pester 3.4 ships with Windows 10).
## Backup downloads
If a main download URL fails (or returns something that doesn't match the hash), setup tries the same file name under the `#mirror` URL in `tools/versions.txt`: the `mods` release on this repo's Gitea. Only the freely licensed files are there (ReHLDS, ReGameDLL, Metamod-R, AMX Mod X, ReAPI, ReUnion, YaPB); `tools/make-mirror.sh` uploads them. After bumping one of those versions, run it again.
## Layout
```
setup.sh, cs, rcon, kills Linux: install, menu, console, kill counter
setup.cmd, cs.cmd Windows: install, menu (scripts in windows/)
.env.example Linux settings template
docker-compose.yml the container; Dockerfile = Debian + 32-bit libs + SteamCMD
cstrike/ configs copied into the game on every setup
defaults/ mapcycle.txt + custom.cfg, copied once, then yours
plugins/ the own plugins (extras, rtv, mode switch), compiled by setup
tools/ pinned downloads (versions*.txt), install-addons.sh, start.sh, hlq.py, make-mirror.sh
scripts/ Linux watchdog, backup, install-cron
hlds/ the game server (downloaded; maps, logs, stats)
```