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

+69 -71
View File
@@ -1,110 +1,110 @@
# cs16-dm-server
A **Counter-Strike 1.6 deathmatch server** in Docker. One command sets it up, and a menu runs it.
A Counter-Strike 1.6 deathmatch server you can set up without knowing anything about servers. It runs on a Windows PC (for playing with friends tonight) or on a Linux machine (for a server that's always on).
Free-for-all deathmatch: instant respawn, a gun menu, no rounds, everyone against everyone. Switch to **GunGame** any time. Bots keep it busy when nobody's on, and they leave as people join. Your friends can join with the Steam version or a non-Steam client.
What you get:
- **One command:** `./setup.sh` asks 5 questions, then downloads the game (SteamCMD) and the mods (pinned versions, checksum-verified), compiles the plugins and starts the server.
- **One menu:** `./cs` shows status, and lets you change the map, switch DM ↔ GunGame, set the bot count, see the kill counter, restart, or update. No console commands to memorize.
- **Game feel:** damage numbers, killstreak and multikill announcer (Quake/UT voices), headshot and knife sounds, +HP per kill, a K/D/streak HUD line, rock-the-vote (`rtv`), `/rank` and `/top15` stats.
- **All-time kill counter** (`./kills`), with top fraggers and favourite weapons. Bots count too, so it climbs fast.
- **Recovers on its own:** Docker restarts the server after a crash, a watchdog restarts it if it hangs, and backups run nightly.
- Free-for-all deathmatch: instant respawn, gun menu, no rounds. GunGame is one menu option away.
- Bots that fill the server when it's empty and leave as people join.
- Damage numbers, killstreak announcer, +HP per kill, rock-the-vote (`rtv`), `/rank` and `/top15`.
- An all-time kill counter.
- Players can join with the Steam version or a non-Steam client.
Built on ReHLDS + ReGameDLL + Metamod-R + AMX Mod X + ReAPI + ReUnion + CSDM-ReAPI + YaPB + GunGame. Details: [docs/HOW-IT-WORKS.md](docs/HOW-IT-WORKS.md).
## Windows
## Quick start
You need 64-bit Windows 10 or 11 and about 1.5 GB of free space.
You need:
- a Linux machine on x86-64 (the game server is 32-bit x86, so no Raspberry Pi or other ARM; any small box or VPS works: with 6 bots the server uses ~10% of one core and ~100 MB of RAM)
- [Docker with the compose plugin](https://docs.docker.com/engine/install/)
- `git` and `python3`
- ~1.5 GB of disk
1. Click **Download ZIP** on this page and unzip it (Downloads is fine).
2. Double-click `setup.cmd`. Answer the questions or press Enter to keep the defaults. It downloads the game (about 600 MB) and starts the server in its own window. Say Yes when Windows asks for admin permission: that lets your friends through the firewall.
3. Setup then asks how your friends will join and helps with that (see below).
The server is installed in `Documents\cs16` (or `C:\Users\<you>\cs16` if your Documents folder is synced by OneDrive). From then on, double-click `cs.cmd` in that folder to start or stop the server, change the map or mode, set the bots, or see the kill counter. Closing the server window stops the server.
Running `setup.cmd` again is safe: it keeps your settings. `setup.cmd -Update` also updates the game files.
This was tested on Windows 10. Windows 11 should work the same way.
## Linux
For a server that stays on. You need an x86-64 machine (no Raspberry Pi: the game server is 32-bit x86), Docker with the compose plugin, `git` and `python3`. With 6 bots it uses about 10% of one core and 100 MB of RAM.
```sh
git clone https://git.userevolt.app/esef/cs16-dm-server.git
cd cs16-dm-server
./setup.sh # asks: server name, join password, port, mode, bots
./scripts/install-cron.sh # optional but recommended: watchdog + nightly backup
./scripts/install-cron.sh # optional: restarts a hung server, nightly backups
```
Run it as a normal user in the `docker` group, not as root. When setup finishes it prints the `connect` addresses.
### Letting people in from the internet
Pick one:
- **Port forward:** forward **UDP 27015** (your `CS_PORT`) on your router to this machine. Players use `connect <your public IP>:27015`.
- **No port forwarding** (CGNAT, dorm, mobile internet): make a free [playit.gg](https://playit.gg) account, install their agent on this machine, and add a tunnel. Choose type **UDP** and local address `127.0.0.1:27015`. Players then use the address playit gives you, for example `connect something.ply.gg:12345`. Every player arrives from playit's IP, and the server is set up for that: `sv_rehlds_maxclients_from_single_ip 16`, short RCON bans. Never ban players by IP, because an IP ban would kick everyone.
- **Just friends:** a VPN like Tailscale or ZeroTier. Everyone joins with `connect <vpn IP>:27015`.
How players join, Steam or not: [docs/PLAYERS.md](docs/PLAYERS.md).
## Running it
Run it as a normal user in the `docker` group, not as root. Then use `./cs` for the menu:
```
./cs menu: pick a number
./cs menu
./cs status who's on, map, mode
./cs map de_inferno change map
./cs mode gg GunGame (./cs mode dm = back to deathmatch; the mode is remembered)
./cs bots 6 fill up to 6 players with bots (0 = none; saved in .env)
./cs kills all-time kill counter
./rcon server console (./rcon <command> for one command)
./cs mode gg GunGame (./cs mode dm goes back)
./cs bots 6 fill up to 6 players with bots (0 = none)
./cs kills kill counter
./rcon server console
```
For admins, maps, fast downloads, several servers and backups, see [docs/ADMIN.md](docs/ADMIN.md).
## How friends join
Everyone opens Counter-Strike 1.6, presses `~` for the console and types `connect <address>`. Which address depends on where they are:
| Where your friends are | What to do | They connect to |
|---|---|---|
| Same house | nothing | the LAN address setup shows, e.g. `192.168.1.20:27015` |
| Anywhere, easiest | free [playit.gg](https://playit.gg) account, add a **UDP** tunnel to `127.0.0.1:27015` | the address playit gives you, e.g. `name.ply.gg:12345` |
| Anywhere, no extra app | forward **UDP 27015** on your router to this PC | your public IP, e.g. `203.0.113.5:27015` |
| A fixed group | everyone installs Tailscale or ZeroTier | your VPN address |
On Windows, setup walks you through these, and `cs.cmd` → 10 brings it back. Port forwarding doesn't work on some connections (mobile internet, many dorms, some fiber providers). If friends can't connect after forwarding, use playit.
With playit, every player arrives from playit's address, so never ban by IP: it would kick everyone.
More for players (Steam and non-Steam): [docs/PLAYERS.md](docs/PLAYERS.md).
## When something goes wrong
- **Setup stopped with an error.** Fix what it says (usually the internet connection) and run it again. It continues where it stopped.
- **Friends can't connect, but you can.** On Windows, run `cs.cmd` → 10 → 1 and accept the admin prompt so the firewall lets them in. If they're not in your house, check the playit tunnel or the port forward.
- **"Unable to initialize Steam" (Windows).** Start the server from `cs.cmd`, not by opening `hlds.exe` directly.
- **The server window closes right away, or setup says files are missing.** Your antivirus probably removed a file. Allow the install folder in it and run `setup.cmd` again.
- **The port is taken.** Setup offers the next free port. Your friends then need that port in the address.
## Settings
The basics live in `.env` (created from [`.env.example`](.env.example) by setup). After editing it, run `./cs apply`, which is the same as `docker compose up -d`.
Windows keeps them in `settings.txt`, Linux in `.env` (same names). After a change, restart the server (`cs.cmd` → 7 on Windows, `./cs apply` on Linux).
| Setting | Default | |
|---|---|---|
| `CS_HOSTNAME` | `CS 1.6 Deathmatch` | name in the server browser |
| `CS_PASSWORD` | empty | join password; empty = open server |
| `CS_PASSWORD` | empty | join password; empty = anyone can join |
| `CS_MAXPLAYERS` | `16` | |
| `CS_PORT` | `27015` | game port (UDP) |
| `CS_MAP` | `de_dust2` | first map; after that `hlds/cstrike/mapcycle.txt` |
| `CS_MODE` | `dm` | starting mode, `dm` or `gg` (first install only; after that use `./cs mode`) |
| `CS_BOTS` | `6` | bots fill the server up to this many players; `0` = no bots |
| `CS_BOT_DIFFICULTY` | `2` | `0` easy … `4` expert |
| `CS_NAME` | `cs16` | Docker container name |
| `CS_MAP` | `de_dust2` | first map, then `mapcycle.txt` |
| `CS_MODE` | `dm` | `dm` or `gg` on the first install; after that the menu remembers it |
| `CS_BOTS` | `6` | bots fill the server up to this many players; `0` = none |
| `CS_BOT_DIFFICULTY` | `2` | `0` easy to `4` expert |
| `CS_NAME` | `cs16` | Docker container name (Linux only) |
Everything else goes in **`hlds/cstrike/custom.cfg`**. It runs after `server.cfg` on every map and setup never overwrites it. Examples are inside: time limit, alltalk, the extras' HP-per-kill and sounds.
Anything else goes in `hlds/cstrike/custom.cfg`, which setup never overwrites. It has examples inside (time limit, alltalk, HP per kill, sounds).
### What the modes are
| | Deathmatch (`dm`) | GunGame (`gg`) |
| | Deathmatch | GunGame |
|---|---|---|
| Plugin | CSDM-ReAPI | GunGame 2.13c |
| Respawn | 0.7 s, 2 s spawn protection | 1 s |
| Weapons | gun menu on spawn | glock → pistols → shotguns → SMGs → rifles → M249 → HE → knife, 2 kills per level |
| Teams | free for all | free for all |
| Map | 20 min | 30 min, 30 s knife warmup |
| Weapons | gun menu on spawn | glock, pistols, shotguns, SMGs, rifles, M249, HE, knife; 2 kills per level |
| Map time | 20 min | 30 min, 30 s knife warmup |
Both use the DM spawn points for the 11 stock maps in the default mapcycle. To add your own maps, see [docs/ADMIN.md](docs/ADMIN.md).
## Layout
```
setup.sh install / re-run / --update
cs, rcon, kills menu, console, kill counter
.env.example settings template (.env is yours, not in git)
docker-compose.yml the container; Dockerfile = Debian + 32-bit libs + SteamCMD
cstrike/ configs copied into the game on every setup (server.cfg, plugin lists, GunGame cfg)
defaults/ mapcycle.txt + custom.cfg, copied once and then yours
plugins/ source of the own plugins (extras, rtv, mode switch), compiled by setup
tools/ versions.txt (pinned downloads + sha256), install-addons.sh, start.sh, hlq.py
scripts/ watchdog, backup, install-cron
hlds/ the game server (downloaded; maps, logs, stats live here)
```
Both are free for all, with spawn points for the 11 stock maps in the default mapcycle. Admins, custom maps, fast downloads and backups: [docs/ADMIN.md](docs/ADMIN.md). How it's put together: [docs/HOW-IT-WORKS.md](docs/HOW-IT-WORKS.md).
## Updating
`git pull && ./setup.sh` picks up new configs and plugins. `./setup.sh --update` also updates the game from Steam. Neither changes your `.env`, secrets, admins (`users.ini`), `mapcycle.txt`, `custom.cfg`, CSDM `config.ini`, stats or the kill counter.
Linux: `git pull && ./setup.sh` (add `--update` to also update the game). Windows: download the new ZIP and run its `setup.cmd`; it updates your existing install. Your settings, passwords, admins, mapcycle, `custom.cfg`, stats and kill counter are kept.
## Credits
Downloaded by setup from their own projects (not part of this repo):
Setup downloads these from their own projects. Each file is checked against a pinned checksum; some have a backup copy on this Gitea in case their site is down.
- [ReHLDS](https://github.com/rehlds/ReHLDS), [ReGameDLL_CS](https://github.com/rehlds/ReGameDLL_CS), [Metamod-R](https://github.com/rehlds/Metamod-R), [ReAPI](https://github.com/rehlds/ReAPI), [ReUnion](https://github.com/rehlds/ReUnion)
- [AMX Mod X](https://www.amxmodx.org)
@@ -112,8 +112,6 @@ Downloaded by setup from their own projects (not part of this repo):
- [YaPB](https://github.com/yapb/yapb)
- [GunGame by Avalanche](https://github.com/fysiks1/amxx-gungame_cstrike)
- DM spawn points from [CSDM 2.1 by Arkshine](https://github.com/Arkshine/CSDM)
- announcer sounds from [hpoon/HLDS-CS1.6](https://github.com/hpoon/HLDS-CS1.6)
- Announcer sounds from [hpoon/HLDS-CS1.6](https://github.com/hpoon/HLDS-CS1.6)
Counter-Strike is Valve's. The game server files come from Steam (SteamCMD, anonymous login).
The scripts, configs and plugins in this repo are MIT licensed ([LICENSE](LICENSE)).
Counter-Strike belongs to Valve. The game files come from Steam (SteamCMD, anonymous login). The scripts, configs and plugins here are MIT licensed ([LICENSE](LICENSE)).