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

+6 -1
View File
@@ -17,10 +17,15 @@ sha() { sha256sum < "$1" | cut -c1-64; }
step "downloads (pinned, checked against tools/versions.txt)"
mkdir -p $DL/gg $DL/snd $DL/spawns
MIRROR=$(sed -n 's/^#mirror //p' $R/tools/versions.txt | tr -d '\r')
grep -v '^#' $R/tools/versions.txt | while read -r f sum url; do
[ -n "$f" ] || continue
[ -f "$DL/$f" ] && [ "$(sha "$DL/$f")" = "$sum" ] && continue
curl -fsSL --retry 3 -o "$DL/$f.part" "$url" || die "download failed: $url"
# main site first; if that fails, the backup copy on the project's Gitea (same checksum check)
curl -fsSL --retry 3 -o "$DL/$f.part" "$url" ||
{ [ -n "$MIRROR" ] && echo " $f: main site failed, trying the backup copy" &&
curl -fsSL --retry 2 -o "$DL/$f.part" "$MIRROR${f##*/}"; } ||
die "download failed: $url"
got=$(sha "$DL/$f.part")
[ "$got" = "$sum" ] || { rm -f "$DL/$f.part"; die "checksum mismatch for $f: expected $sum, got $got"; }
mv "$DL/$f.part" "$DL/$f"
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
# For the maintainer: puts backup copies of the freely licensed downloads on the Gitea release
# "mods", which setup falls back to when a main site is down (see "#mirror" in versions.txt).
# Only MIT / GPL / Unlicense files are mirrored; the rest (CSDM-ReAPI, GunGame, sounds, spawn
# files) has no license and stays download-only.
# sh tools/make-mirror.sh uses your saved git login for git.userevolt.app
# GITEA_TOKEN=<token, repo read+write> sh tools/make-mirror.sh
# Needs curl and python3 (or python). Safe to run again: files already on the release are skipped.
set -e
cd "$(dirname "$0")/.."
API=https://git.userevolt.app/api/v1/repos/esef/cs16-dm-server
TAG=mods
PY=$(command -v python3 || command -v python) || { echo "needs python3"; exit 1; }
DIR=$(mktemp -d); trap 'rm -rf "$DIR"' EXIT
CFG=$DIR/curl.cfg # credentials go to curl through a file, not the command line
umask 077
if [ -n "$GITEA_TOKEN" ]; then
printf 'header = "Authorization: token %s"\n' "$GITEA_TOKEN" > "$CFG"
else
cred=$(printf 'protocol=https\nhost=git.userevolt.app\n\n' | GIT_TERMINAL_PROMPT=0 git credential fill 2>/dev/null) ||
{ echo "no saved git login for git.userevolt.app: push once, or set GITEA_TOKEN"; exit 1; }
u=$(printf '%s\n' "$cred" | sed -n 's/^username=//p')
pw=$(printf '%s\n' "$cred" | sed -n 's/^password=//p')
printf 'user = "%s:%s"\n' "$u" "$pw" > "$CFG"
fi
umask 022
json() { "$PY" -c "import json,sys; d=json.load(sys.stdin); print($1)"; }
curl -fsS -K "$CFG" -o /dev/null https://git.userevolt.app/api/v1/user ||
{ echo "Gitea didn't accept the login (wrong or expired?)"; exit 1; }
echo "== downloading and checking"
cat tools/versions.txt tools/versions-windows.txt | tr -d '\r' | grep -v '^#' |
grep -E '^(rehlds-bin|regamedll-bin|metamod-bin|amxmodx-|reapi-bin|reunion-|yapb-)' |
while read -r f sum url; do
curl -fsSL --retry 3 -o "$DIR/$f" "$url"
got=$( (sha256sum "$DIR/$f" 2>/dev/null || shasum -a 256 "$DIR/$f") | cut -c1-64)
[ "$got" = "$sum" ] || { echo "checksum mismatch for $f"; exit 1; }
echo " ok $f"
done
echo "== release '$TAG'"
id=$(curl -fsS -K "$CFG" "$API/releases/tags/$TAG" 2>/dev/null | json "d['id']" || true)
if [ -z "$id" ]; then
body='Backup copies of the mod downloads, used by setup only when a main site is down. Every file is checked against tools/versions.txt before it is installed. Sources and licenses: ReHLDS, ReGameDLL_CS (MIT), Metamod-R, ReAPI, ReUnion (GPL-3.0) at github.com/rehlds; AMX Mod X (GPL-3.0) at github.com/alliedmodders/amxmodx; YaPB (Unlicense) at github.com/yapb/yapb.'
id=$(printf '{"tag_name":"%s","target_commitish":"main","name":"Mod downloads (backup copies)","body":"%s"}' "$TAG" "$body" |
curl -fsS -K "$CFG" -H 'Content-Type: application/json' -d @- "$API/releases" | json "d['id']")
echo " created (id $id)"
else
echo " exists (id $id)"
fi
have=$(curl -fsS -K "$CFG" "$API/releases/$id/assets" | json "'\n'.join(a['name'] for a in d)")
echo "== uploading"
for p in "$DIR"/*; do
f=$(basename "$p")
if printf '%s\n' "$have" | grep -qxF "$f"; then echo " have $f"; continue; fi
curl -fsS -K "$CFG" -F "attachment=@$p" "$API/releases/$id/assets?name=$f" > /dev/null
echo " up $f"
done
echo "done: https://git.userevolt.app/esef/cs16-dm-server/releases/tag/$TAG"
+8
View File
@@ -0,0 +1,8 @@
# Windows-only pinned downloads (windows/setup.ps1). Same format as versions.txt.
# Windows uses versions.txt minus the files with "-linux" in their name, plus this list.
# AMX Mod X 1.10 Windows build (GPL-3.0)
amxmodx-1.10.0-git5486-base-windows.zip 9016824ac5ae0751e1aa9647ad9a506fcf4af6e63ad1ccf5dd7769025b00c6a0 https://www.amxmodx.org/amxxdrop/1.10/amxmodx-1.10.0-git5486-base-windows.zip
amxmodx-1.10.0-git5486-cstrike-windows.zip 56f0f4bf0148005e7cf1151a50ac701c84e73c3d35627514a4dbf0ab52e15450 https://www.amxmodx.org/amxxdrop/1.10/amxmodx-1.10.0-git5486-cstrike-windows.zip
# YaPB Windows build (Unlicense)
yapb-4.4.957-windows.zip c32a5b4d77c08c3c59c417568c5719f9227238c6d627d478cfb1d9f7d9c113f4 https://github.com/yapb/yapb/releases/download/4.4.957/yapb-4.4.957-windows.zip
+4
View File
@@ -1,6 +1,10 @@
# Pinned third-party downloads: <file in dl/> <sha256> <url>
# setup.sh fetches each one into dl/ and refuses to install it if the hash differs.
# Bump a version: change url + file name, run ./setup.sh, put the new hash it prints here.
# Windows (windows/setup.ps1) skips the files with "-linux" in their name and adds tools/versions-windows.txt.
# If a main URL fails, setup tries <mirror><file name> instead (still checked against the hash).
# Only freely licensed files are mirrored there (tools/make-mirror.sh); the rest just fails as before.
#mirror https://git.userevolt.app/esef/cs16-dm-server/releases/download/mods/
# engine + game: ReHLDS, ReGameDLL_CS (MIT)
rehlds-bin-3.15.0.896.zip 997baeb7ef3842dab3e034d82dc651ebfe560c23b158adce660a6b97976b4e2b https://github.com/rehlds/ReHLDS/releases/download/3.15.0.896/rehlds-bin-3.15.0.896.zip