# megastructure.surf 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 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 fixes and enhancements - **JSON Zone Loading** - Automatic zone loading from surf-zones repository ## Architecture ### Docker Service #### `cssds` (CSS Dedicated Server) - Based on Debian Bookworm - Runs SteamCMD to download/update CSS DS - Installs MetaMod:Source and SourceMod - Installs surf-specific plugins and timer system - Runs in 32-bit mode for plugin compatibility - Port: 27015 (configurable via `SRCDS_PORT`) ### Key Files ``` . ├── docker-compose.yaml # Service orchestration ├── etc/ │ ├── cssds.dockerfile # CSS DS container definition │ ├── run.sh # Main setup and launch script │ ├── update_cssds.txt # SteamCMD script for CSS DS │ └── cfg/ │ └── server.cfg # Server configuration └── data/ # Persistent data (volume mount) └── cssds/ # CSS server files and database ``` ## Installed Plugins & Extensions ### Timer System **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 - **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 - 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 **MomSurfFix v1.1.5** ([GitHub](https://github.com/GAMMACASE/MomSurfFix)) - Fixes Source engine surf physics to match Momentum Mod behavior - Essential for proper surf mechanics **EventQueue Fix v1.3.2** ([GitHub](https://github.com/hermansimensen/eventqueue-fix)) - Fixes map entity timing issues - Ensures triggers and outputs work correctly **RNGFix v1.1.3** ([GitHub](https://github.com/jason-e/rngfix)) - 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` for full list) ## Setup & Usage ### Prerequisites - Docker - Docker Compose - ~10GB disk space for server files ### Environment Variables Configure in `docker-compose.yaml` or `.env` file: ```yaml # 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 container docker-compose build # Start the server docker-compose up -d # View logs docker-compose logs -f cssds # Restart the server docker-compose restart cssds # Stop the server docker-compose down ``` ### Update Server Files The server installation is persistent - game files are only downloaded on first run. To force an update: ```bash # Update CSS game files docker-compose run cssds bash ./etc/run.sh --update-cssds ``` 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: **Automatic Setup:** - 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 - URL: `https://wrldspawn.github.io/surf-zones/z/{map}.json` **Configuration Files Created:** - `cfg/sourcemod/plugin.shavit-zones.cfg` - Disables SQL zones - `cfg/sourcemod/plugin.shavit-zones-json.cfg` - Sets JSON URL - `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 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 (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