From 43883f384167a53d9ccf4e0d16ff0e708dd58243 Mon Sep 17 00:00:00 2001 From: Nathan Rashleigh Date: Mon, 9 Feb 2026 18:15:01 +1100 Subject: [PATCH] YUH --- .env | 4 +- README.md | 412 +++++++++++++++++++++++-------------------- etc/cfg/server.cfg | 7 + etc/cssds.dockerfile | 15 +- etc/run.sh | 408 +++++++++++++++++++++++++++++------------- surf.sublime-project | 9 +- 6 files changed, 539 insertions(+), 316 deletions(-) diff --git a/.env b/.env index 8070242..5ac417a 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ STEAMAPPID=232330 STEAMAPP=css SRCDS_TOKEN=C02633B3395EA6BEF7D8DFBA440ABB7F -SRCDS_RCONPW="lol" +SRCDS_RCONPW="reebok" SRCDS_PW="6" SRCDS_STARTMAP="surf_boreas" @@ -28,6 +28,7 @@ SRCDS_WORKSHOP_AUTHKEY="" SRCDS_CFG="server.cfg" SRCDS_MAPCYCLE="mapcycle.txt" +SRCDS_ADMINS="STEAM_1:1:12270329" # ---------- # mariadb @@ -35,3 +36,4 @@ MARIADB_ROOT_PASSWORD="surfsup" MARIADB_DATABASE="influx" MARIADB_USER="influx" MARIADB_PASSWORD="righteous" + diff --git a/README.md b/README.md index 3dbd7ba..8f2c5bb 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,30 @@ # megastructure.surf -A Docker-based Counter-Strike: Source surf server with Shavit BHopTimer and community physics fix plugins. +A Docker-based Counter-Strike: Source surf server with Shavit Surf Timer and community physics fix plugins. ## Overview This repository contains a complete CSS surf server setup using Docker containers. The setup includes: -- **CSS Dedicated Server (CSSDS)** - Running on 64-bit binaries for improved performance -- **Shavit BHopTimer** - Actively maintained timer system (v4.0.1) with MySQL support -- **MariaDB** - Database backend for timer records and player data +- **CSS Dedicated Server (CSSDS)** - Running in 32-bit mode for compatibility +- **Shavit Surf Timer** - Surf-specific fork (v1.0.6) with JSON zone support and SQLite - **MetaMod:Source** - Plugin loader framework - **SourceMod** - Server administration and plugin platform -- **Community Physics Plugins** - Essential surf/bhop fixes and enhancements +- **Community Physics Plugins** - Essential surf fixes and enhancements +- **JSON Zone Loading** - Automatic zone loading from surf-zones repository ## Architecture -### Docker Services +### Docker Service #### `cssds` (CSS Dedicated Server) - Based on Debian Bookworm -- Runs SteamCMD to download/update CSS DS and TF2 DS (for 64-bit binaries) +- Runs SteamCMD to download/update CSS DS - Installs MetaMod:Source and SourceMod - Installs surf-specific plugins and timer system -- Uses 64-bit server binaries for better performance +- Runs in 32-bit mode for plugin compatibility - Port: 27015 (configurable via `SRCDS_PORT`) -#### `mariadb` (Database) -- MariaDB 10.11 for timer data persistence -- Stores player records, map times, rankings -- Port: 3306 (internal) -- Data persisted in `./sql:/var/lib/mysql` - ### Key Files ``` @@ -38,30 +32,46 @@ This repository contains a complete CSS surf server setup using Docker container ├── docker-compose.yaml # Service orchestration ├── etc/ │ ├── cssds.dockerfile # CSS DS container definition -│ ├── mariadb.dockerfile # MariaDB container definition │ ├── run.sh # Main setup and launch script │ ├── update_cssds.txt # SteamCMD script for CSS DS -│ ├── update_tf2ds.txt # SteamCMD script for TF2 DS (64-bit libs) │ └── cfg/ │ └── server.cfg # Server configuration -└── sql/ # MariaDB data directory (volume mount) +└── data/ # Persistent data (volume mount) + └── cssds/ # CSS server files and database ``` -## Installed Plugins +## Installed Plugins & Extensions ### Timer System -**Shavit BHopTimer v4.0.1** ([GitHub](https://github.com/shavitush/bhoptimer)) -- Actively maintained (last update: February 2026) -- Full surf/bhop timer with MySQL backend +**Shavit Surf Timer v1.0.6** ([GitHub](https://github.com/bhopppp/Shavit-Surf-Timer)) +- Surf-specific fork with enhanced features +- Full surf timer with SQLite backend (no separate database needed) - Replays, rankings, zone system, statistics -- Better SQL schema design than archived alternatives -- Config location: `addons/sourcemod/configs/shavit/` -- **Configured to use JSON zones** from [surf-zones](https://github.com/wrldspawn/surf-zones) repository +- **JSON zone support** from [surf-zones](https://github.com/wrldspawn/surf-zones) repository - Zones loaded from `https://wrldspawn.github.io/surf-zones/z/{map}.json` - Includes stripper configurations and mapfixes - Matches KSF (Kreedz Surf Federation) server behavior - - Use `!setmaxvel` in-game to configure max velocity per map +- Config location: `addons/sourcemod/configs/shavit/` + +### Required Extensions + +**sm-json v5.0.1** ([GitHub](https://github.com/clugg/sm-json)) +- Pure SourcePawn JSON library for zone loading +- Provides `JSONArray.FromFile()` for loading JSON zones + +**sm_closestpos v1.1.1** ([GitHub](https://github.com/rtldg/sm_closestpos)) +- Required for ghost/replay functionality +- Enables replay bot positioning + +**sm-ripext v1.3.2** ([GitHub](https://github.com/ErikMinekus/sm-ripext)) +- HTTP/REST extension for Shavit +- Required for shavit-wrsh plugin +- Alternative JSON/HTTP support + +**DHooks v2.2.0** ([GitHub](https://github.com/peace-maker/DHooks2)) +- Included with SourceMod +- Required by most modern plugins ### Physics Fix Plugins @@ -69,10 +79,6 @@ This repository contains a complete CSS surf server setup using Docker container - Fixes Source engine surf physics to match Momentum Mod behavior - Essential for proper surf mechanics -**PushFix Definitive Edition v1.0.0** ([GitHub](https://github.com/GAMMACASE/PushFixDE)) -- Fixes player collision and push mechanics -- Prevents physics exploits - **EventQueue Fix v1.3.2** ([GitHub](https://github.com/hermansimensen/eventqueue-fix)) - Fixes map entity timing issues - Ensures triggers and outputs work correctly @@ -81,13 +87,15 @@ This repository contains a complete CSS surf server setup using Docker container - Fixes Source engine RNG determinism issues - Ensures consistent physics behavior +**Note:** PushFix Definitive Edition is NOT installed as it's CS:GO only and not compatible with CSS. + ### Base Plugins SourceMod includes built-in plugins for server administration: - Admin Menu, Basic Commands, Player Commands - Rock The Vote, Map Nominations, MapChooser - Reserved Slots, Basic Bans -- And more (see `etc/run.sh` comments for full list) +- And more (see `etc/run.sh` for full list) ## Setup & Usage @@ -99,173 +107,218 @@ SourceMod includes built-in plugins for server administration: ### Environment Variables -Configure in `docker-compose.yaml`: +Configure in `docker-compose.yaml` or `.env` file: ```yaml -METAMOD_VERSION: "1.11" # MetaMod:Source version -SOURCEMOD_VERSION: "1.11" # SourceMod version +# Server Settings +METAMOD_VERSION: "1.12" # MetaMod:Source version +SOURCEMOD_VERSION: "1.12" # SourceMod version SRCDS_PORT: 27015 # Server port SRCDS_MAXPLAYERS: 32 # Max player slots SRCDS_STARTMAP: "surf_ski_2" # Starting map +SRCDS_IP: "0.0.0.0" # Bind IP address + +# Admin Configuration (comma-separated Steam IDs) +SRCDS_ADMINS: "STEAM_1:0:12345678,STEAM_1:1:87654321" ``` +**Admin Steam ID Format:** +- Use `STEAM_1:Y:XXXXXX` format (recommended) +- Or `[U:1:XXXXXX]` format (modern SteamID3) +- Find your Steam ID in-game with `status` command +- Or use https://steamid.io/ + ### Building & Running ```bash -# Build the containers +# Build the container docker-compose build -# Start the services +# Start the server docker-compose up -d # View logs docker-compose logs -f cssds -# Stop the services +# Restart the server +docker-compose restart cssds + +# Stop the server docker-compose down ``` -### First-Time Database Configuration +### Update Server Files -After the first build, configure Shavit to use MariaDB: +The server installation is persistent - game files are only downloaded on first run. To force an update: -1. Edit `addons/sourcemod/configs/databases.cfg`: -``` -"Databases" -{ - "shavit" - { - "driver" "mysql" - "host" "mariadb" - "database" "shavit" - "user" "root" - "pass" "your_password" - } -} +```bash +# Update CSS game files +docker-compose run cssds bash ./etc/run.sh --update-cssds ``` -2. Shavit will automatically create tables on first connection +Or modify the environment to skip updates by default (already configured): +- Default: Updates are **skipped** for faster restarts +- Use `--update-cssds` flag to force updates + +### Database Configuration + +The server uses **SQLite by default** (no separate database needed): +- Database file: `addons/sourcemod/data/sqlite/shavit-local.sq3` +- Automatically created on first run +- Stores player times, rankings, and replay data + +**To switch to MariaDB later** (optional): +1. Edit `addons/sourcemod/configs/databases.cfg` +2. Change driver from `sqlite` to `mysql` +3. Configure host, database, user, password +4. Restart server ### JSON Zones Configuration -The server is **automatically configured** to use JSON zones instead of SQL-based zones. This provides several advantages: +The server is **automatically configured** to use JSON zones instead of SQL-based zones: **Automatic Setup:** -- Zones are loaded from the community-maintained [surf-zones](https://github.com/wrldspawn/surf-zones) repository -- Includes 400+ maps with pre-configured zones, stripper configs, and mapfixes +- Zones loaded from [surf-zones](https://github.com/wrldspawn/surf-zones) repository +- Includes 400+ maps with pre-configured zones - No manual zone creation needed for supported maps -- Automatically downloads: `https://wrldspawn.github.io/surf-zones/z/{map}.json` +- URL: `https://wrldspawn.github.io/surf-zones/z/{map}.json` **Configuration Files Created:** -- `cfg/sourcemod/plugin.shavit-zones.cfg` - Disables SQL zones (`shavit_zones_usesql "0"`) +- `cfg/sourcemod/plugin.shavit-zones.cfg` - Disables SQL zones - `cfg/sourcemod/plugin.shavit-zones-json.cfg` - Sets JSON URL -- `addons/stripper/` - Map entity fixes and modifications -- `addons/sourcemod/configs/shavit-mapfixes.cfg` - Map-specific settings +- `addons/stripper/` - Map entity fixes +- `addons/sourcemod/configs/shavit-mapfixes.cfg` - Map settings - `addons/sourcemod/configs/shavit-styles.cfg` - KSF-style configurations **Benefits:** -- ✅ No manual zone editing required for popular maps -- ✅ Community-maintained and regularly updated -- ✅ Includes map fixes for common issues -- ✅ Matches KSF server behavior and standards -- ✅ Faster deployment (no SQL import needed) - -**Important Note:** The `sv_maxvelocity` settings in mapfixes won't auto-apply. After loading a map, use the in-game command: -``` -!setmaxvel -``` -For most surf maps, use `!setmaxvel 3500`. Some maps may require different values (check surf-zones repo for specific maps). +- ✅ No manual zone editing for popular maps +- ✅ Community-maintained and updated +- ✅ Includes map fixes +- ✅ Matches KSF server standards +- ✅ Faster deployment ### Server Configuration Edit `etc/cfg/server.cfg` for server settings: -- Hostname, rcon password -- Game settings (gravity, air accelerate, etc.) -- SourceMod configurations +- Hostname, RCON password (change default!) +- Surf physics (gravity, air accelerate, max velocity) +- HUD settings (minimal by default) +- Network rates +- Player settings + +**Important:** Change the default RCON password: +```cfg +rcon_password "changeme" // CHANGE THIS! +``` + +## In-Game Commands + +### Admin Commands +``` +rcon_password // Authenticate RCON +rcon sm_admin // Open admin menu +sm_map // Change map +sm_kick // Kick player +sm_ban