This commit is contained in:
Nathan Rashleigh
2026-02-08 22:44:17 +11:00
parent 4dbaaf1ec5
commit f08be1d72c
7 changed files with 804 additions and 76 deletions
+128 -55
View File
@@ -1,66 +1,139 @@
// ================================================================
// megastructure.surf - CSS Surf Server Configuration
// ================================================================
hostname "megastructure.surf"
// surf specific
sv_accelerate 10
sv_airaccelerate 800
mp_falldamage 0
sv_enablebunnyhopping 1
sv_autobunnyhopping 1
sv_staminamax 0
sv_staminajumpcost 0
sv_staminalandcost 0
sv_staminarecoveryrate 0
sv_accelerate_use_weapon_speed 0
// ================================================================
// SURF PHYSICS - Critical settings for proper surf mechanics
// ================================================================
// server stuff
sv_visiblemaxplayers 24
mp_maxrounds 1
host_framerate 0
setpause 0
sv_pure 0
sv_pausable 0
sv_lan 0
sv_stats 1
sv_gravity 800 // Default gravity (standard for surf)
sv_accelerate 10 // Ground acceleration
sv_airaccelerate 800 // Air acceleration (high for surf)
sv_friction 4 // Surface friction
sv_maxvelocity 3500 // Max velocity (can be changed per-map with !setmaxvel)
// Execute Banned Users //
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip
// Stamina (disable for surf)
sv_staminamax 0 // No stamina limit
sv_staminajumpcost 0 // No stamina cost for jumping
sv_staminalandcost 0 // No stamina cost for landing
sv_staminarecoveryrate 0 // No stamina recovery needed
// Contact & Region //
sv_contact ntr@megastructure.games
sv_region 5
// Bunnyhopping
sv_enablebunnyhopping 1 // Enable bunnyhop
sv_autobunnyhopping 0 // Disable autobhop (hold space) - players must time jumps
sv_accelerate_use_weapon_speed 0 // Weapon weight doesn't affect acceleration
// Rcon Settings //
rcon_password changeme
sv_rcon_banpenalty 1440
sv_rcon_maxfailures 5
// Fall damage and movement
mp_falldamage 0 // No fall damage
phys_pushscale 1000 // Push force multiplier
// Log Settings //
log on
sv_log_onefile 0
sv_logfile 1
sv_logbans 1
sv_logecho 1
// ================================================================
// GAME MODE SETTINGS
// ================================================================
// Rate Settings //
fps_max 600
sv_minrate 0
sv_maxrate 20000
sv_minupdaterate 66
sv_maxupdaterate 66
mp_teamplay 0 // Not team-based
mp_friendlyfire 0 // No friendly fire
mp_autoteambalance 0 // Don't force team balance
mp_limitteams 0 // No team limits
mp_freezetime 0 // No freeze time at round start
mp_roundtime 60 // 60 minute rounds (effectively infinite)
mp_maxrounds 1 // One continuous round
mp_timelimit 0 // No time limit
mp_winlimit 0 // No win limit
// Download Settings //
sv_allowupload 1
sv_allowdownload 1
net_maxfilesize 500
// Respawn settings
mp_respawn_on_death_ct 1 // CT respawns instantly
mp_respawn_on_death_t 1 // T respawns instantly
mp_respawnwavetime_ct 0 // Instant respawn for CT
mp_respawnwavetime_t 0 // Instant respawn for T
sv_cheats 0
sv_timeout 900
mp_idlemaxtime 60
mp_idledealmethod 2
// ================================================================
// SERVER SETTINGS
// ================================================================
// Communications //
sv_voiceenable 1
sv_alltalk 0
sv_lan 0 // Internet server
sv_pure 0 // Allow custom files
sv_cheats 0 // No cheats
sv_pausable 0 // Can't pause
sv_alltalk 1 // Players can talk across teams (standard for surf)
sv_voiceenable 1 // Enable voice chat
sv_enableoldqueries 1 // Support legacy server queries
sv_contact "ntr@megastructure.games" // Admin contact
sv_region 5 // Region: Asia (0=US East, 1=US West, 2=South America, 3=Europe, 4=Asia, 5=Australia, 6=Middle East, 7=Africa)
// Player settings
sv_visiblemaxplayers -1 // Show actual max players (-1 = use maxplayers)
mp_idlemaxtime 0 // No idle kick (let Shavit handle this)
mp_idledealmethod 0 // Don't deal with idle players
sv_timeout 900 // 15 minute timeout
// ================================================================
// RCON SETTINGS
// ================================================================
rcon_password "changeme" // CHANGE THIS!
sv_rcon_banpenalty 1440 // Ban for 24 hours after failed attempts
sv_rcon_maxfailures 5 // Max failed rcon attempts
// ================================================================
// NETWORK & RATE SETTINGS
// ================================================================
// Server rates
fps_max 600 // Server FPS limit (0 = unlimited, but 600 is good)
sv_mincmdrate 66 // Min client command rate
sv_maxcmdrate 128 // Max client command rate
sv_minupdaterate 66 // Min client update rate
sv_maxupdaterate 128 // Max client update rate
sv_minrate 20000 // Min client data rate (20KB/s)
sv_maxrate 0 // Max client data rate (0 = unlimited)
// Network settings
net_maxfilesize 64 // Max download file size (MB)
sv_allowupload 1 // Allow uploads
sv_allowdownload 1 // Allow downloads
sv_downloadurl "" // FastDL URL (set this if you have FastDL)
// ================================================================
// BOT SETTINGS
// ================================================================
bot_quota 0 // No bots
bot_kick // Kick any existing bots
// ================================================================
// LOGGING
// ================================================================
log on // Enable logging
sv_logfile 1 // Log to file
sv_log_onefile 0 // Separate log files per map
sv_logbans 1 // Log bans
sv_logecho 0 // Don't echo logs to console (reduces spam)
sv_logflush 0 // Don't flush logs every line (better performance)
// ================================================================
// SOURCEMOD / METAMOD
// ================================================================
// These are loaded automatically via metamod/sourcemod
// No manual commands needed here
// ================================================================
// EXECUTE ADDITIONAL CONFIGS
// ================================================================
exec banned_user.cfg // Load banned users
exec banned_ip.cfg // Load banned IPs
writeid // Write user IDs
writeip // Write banned IPs
// ================================================================
// MESSAGES
// ================================================================
echo "=========================================="
echo "megastructure.surf loaded successfully"
echo "=========================================="
+2 -3
View File
@@ -23,6 +23,8 @@ ENV CSSDS="/home/steam/cssds"
ENV TF2DS="/home/steam/tf2ds"
ENV STEAMCMD="/home/steam/steamcmd"
ENV ETC="/home/steam/etc"
ENV METAMOD_VERSION=1.12
ENV SOURCEMOD_VERSION=1.12
# ensure gamedirs exist and have been chowned to steam
# before they potentially get setup as docker volumes
@@ -35,8 +37,5 @@ FROM build AS steam
USER steam
WORKDIR /home/steam
ENV METAMOD_VERSION 1.12
ENV SOURCEMOD_VERSION 1.12
COPY . /home/steam/etc
CMD ["bash", "./etc/run.sh"]
+41
View File
@@ -0,0 +1,41 @@
FROM cm2network/steamcmd AS build
LABEL maintainer="ntr@megastructure.games"
EXPOSE 27015/tcp \
27015/udp \
27020/udp
USER root
RUN apt-get update
RUN apt-get install -y \
wget \
ca-certificates \
zlib1g \
lib32gcc-s1 \
libncurses5 \
libbz2-1.0 \
libtinfo5 \
libcurl3-gnutls \
unzip \
rcon
ENV CSSDS="/home/steam/cssds"
ENV TF2DS="/home/steam/tf2ds"
ENV STEAMCMD="/home/steam/steamcmd"
ENV ETC="/home/steam/etc"
ENV METAMOD_VERSION=1.12
ENV SOURCEMOD_VERSION=1.12
# ensure gamedirs exist and have been chowned to steam
# before they potentially get setup as docker volumes
# which would otherwise cause them to be owned by root
RUN mkdir -p "$CSSDS" "$TF2DS" "$STEAMCMD" "$ETC"
RUN chown -R steam:steam /home/steam
FROM build AS steam
USER steam
WORKDIR /home/steam
COPY . /home/steam/etc
CMD ["bash", "./etc/run.sh"]
-1
View File
@@ -1 +0,0 @@
/etc/mysql/conf.d/
+255 -11
View File
@@ -47,24 +47,211 @@ install_sourcemod() {
install_surf() {
cd $CSTRIKE
if [ ! -d "$CSTRIKE/cfg/influx" ]; then
wget "https://influxtimer.com/dl/influx_2_surf.zip"
unzip "influx_2_surf.zip"
rm "influx_2_surf.zip"
# Install Shavit BHopTimer (replaces InfluxTimer)
if [ ! -d "$CSTRIKE/addons/sourcemod/configs/shavit" ]; then
wget "https://github.com/shavitush/bhoptimer/releases/download/v4.0.1/bhoptimer-v4.0.1.zip"
unzip "bhoptimer-v4.0.1.zip"
rm "bhoptimer-v4.0.1.zip"
echo "--------------------------------------------------------------"
echo "Installed InfluxTimer"
echo "Installed Shavit BHopTimer v4.0.1"
echo "--------------------------------------------------------------"
fi
if [ ! -d "$CSTRIKE/addons/sourcemod/scripting/momsurffix" ]; then
wget "https://influxtimer.com/dl/influx_2_surf.zip"
# Install MomSurfFix
if [ ! -f "$CSTRIKE/addons/sourcemod/plugins/momsurffix2.smx" ]; then
wget "https://github.com/GAMMACASE/MomSurfFix/releases/download/1.1.5/MomSurfFix2v1.1.5.zip"
unzip "MomSurfFix2v1.1.5.zip"
rm "MomSurfFix2v1.1.5.zip"
echo "--------------------------------------------------------------"
echo "Installed MomSurfFix2v1.1.5"
echo "Installed MomSurfFix v1.1.5"
echo "--------------------------------------------------------------"
fi
# Install PushFix Definitive Edition
if [ ! -f "$CSTRIKE/addons/sourcemod/plugins/pushfix_de.smx" ]; then
wget "https://github.com/GAMMACASE/PushFixDE/releases/download/1.0.0/pushfix_de_1.0.0.zip"
unzip "pushfix_de_1.0.0.zip"
rm "pushfix_de_1.0.0.zip"
echo "--------------------------------------------------------------"
echo "Installed PushFix Definitive Edition v1.0.0"
echo "--------------------------------------------------------------"
fi
# Install EventQueue Fix
if [ ! -f "$CSTRIKE/addons/sourcemod/plugins/eventqueuefix.smx" ]; then
wget "https://github.com/hermansimensen/eventqueue-fix/releases/download/1.3.2/eventqueuefix-1.3.2.zip"
unzip "eventqueuefix-1.3.2.zip"
rm "eventqueuefix-1.3.2.zip"
echo "--------------------------------------------------------------"
echo "Installed EventQueue Fix v1.3.2"
echo "--------------------------------------------------------------"
fi
# Install RNGFix
if [ ! -f "$CSTRIKE/addons/sourcemod/plugins/rngfix.smx" ]; then
wget "https://github.com/jason-e/rngfix/releases/download/v1.1.3/rngfix_1.1.3.zip"
unzip "rngfix_1.1.3.zip"
rm "rngfix_1.1.3.zip"
echo "--------------------------------------------------------------"
echo "Installed RNGFix v1.1.3"
echo "--------------------------------------------------------------"
fi
}
configure_shavit_zones() {
cd $CSTRIKE
# Check if already configured
if [ -f "$CSTRIKE/addons/sourcemod/configs/shavit-mapfixes.cfg" ]; then
echo "--------------------------------------------------------------"
echo "Shavit zones already configured"
echo "--------------------------------------------------------------"
return
fi
echo "--------------------------------------------------------------"
echo "Configuring Shavit to use JSON zones from surf-zones repo"
echo "--------------------------------------------------------------"
# Download surf-zones repository
cd /tmp
wget "https://github.com/wrldspawn/surf-zones/archive/refs/heads/main.zip" -O surf-zones.zip
unzip -q surf-zones.zip
# Copy stripper directory
if [ -d "surf-zones-main/addons/stripper" ]; then
mkdir -p "$CSTRIKE/addons/stripper"
cp -r surf-zones-main/addons/stripper/* "$CSTRIKE/addons/stripper/"
echo "Copied stripper configurations"
fi
# Copy mapfixes configuration
if [ -f "surf-zones-main/addons/sourcemod/configs/shavit-mapfixes.cfg" ]; then
mkdir -p "$CSTRIKE/addons/sourcemod/configs"
cp surf-zones-main/addons/sourcemod/configs/shavit-mapfixes.cfg "$CSTRIKE/addons/sourcemod/configs/"
echo "Copied shavit-mapfixes.cfg"
fi
# Copy styles configuration (optional - removes irrelevant styles, matches KSF behavior)
if [ -f "surf-zones-main/addons/sourcemod/configs/shavit-styles.cfg" ]; then
cp surf-zones-main/addons/sourcemod/configs/shavit-styles.cfg "$CSTRIKE/addons/sourcemod/configs/"
echo "Copied shavit-styles.cfg"
fi
# Cleanup
rm -rf surf-zones-main surf-zones.zip
# Create cfg directory for plugin configs if it doesn't exist
mkdir -p "$CSTRIKE/cfg/sourcemod"
# Configure zones plugin to use JSON instead of SQL
cat > "$CSTRIKE/cfg/sourcemod/plugin.shavit-zones.cfg" <<'EOF'
// Shavit Zones Plugin Configuration
// Set to 0 to use JSON zones instead of SQL database
shavit_zones_usesql "0"
EOF
# Configure JSON zones URL
cat > "$CSTRIKE/cfg/sourcemod/plugin.shavit-zones-json.cfg" <<'EOF'
// Shavit JSON Zones Configuration
// URL template for loading zone data - {map} will be replaced with map name
shavit_zones_json_url "https://wrldspawn.github.io/surf-zones/z/{map}.json"
EOF
echo "--------------------------------------------------------------"
echo "Configured Shavit to use JSON zones"
echo "JSON URL: https://wrldspawn.github.io/surf-zones/z/{map}.json"
echo "Note: Use !setmaxvel in-game to set max velocity per map"
echo "--------------------------------------------------------------"
}
configure_shavit_database() {
cd $CSTRIKE
# Check if database config already exists
if [ -f "$CSTRIKE/addons/sourcemod/configs/databases.cfg" ]; then
# Check if shavit database entry already exists
if grep -q '"shavit"' "$CSTRIKE/addons/sourcemod/configs/databases.cfg"; then
echo "--------------------------------------------------------------"
echo "Shavit database already configured"
echo "--------------------------------------------------------------"
return
fi
fi
echo "--------------------------------------------------------------"
echo "Configuring Shavit database connection"
echo "--------------------------------------------------------------"
# Set defaults if environment variables are not set
DB_HOST="${MYSQL_HOST:-mariadb}"
DB_PORT="${MYSQL_PORT:-3306}"
DB_NAME="${MYSQL_DATABASE:-shavit}"
DB_USER="${MYSQL_USER:-root}"
DB_PASS="${MYSQL_ROOT_PASSWORD:-changeme}"
# Create or append to databases.cfg
mkdir -p "$CSTRIKE/addons/sourcemod/configs"
# If databases.cfg doesn't exist, create it with full structure
if [ ! -f "$CSTRIKE/addons/sourcemod/configs/databases.cfg" ]; then
cat > "$CSTRIKE/addons/sourcemod/configs/databases.cfg" <<EOF
"Databases"
{
"driver_default" "mysql"
// Shavit BHopTimer Database
"shavit"
{
"driver" "mysql"
"host" "$DB_HOST"
"port" "$DB_PORT"
"database" "$DB_NAME"
"user" "$DB_USER"
"pass" "$DB_PASS"
}
// Default SourceMod database (local SQLite)
"default"
{
"driver" "sqlite"
"database" "sourcemod-local"
}
// Storage database (can also use MySQL if desired)
"storage-local"
{
"driver" "sqlite"
"database" "sourcemod-local"
}
}
EOF
else
# Append shavit config to existing databases.cfg (before closing brace)
# Remove the last closing brace, add shavit config, then add closing brace back
sed -i '$ d' "$CSTRIKE/addons/sourcemod/configs/databases.cfg"
cat >> "$CSTRIKE/addons/sourcemod/configs/databases.cfg" <<EOF
// Shavit BHopTimer Database
"shavit"
{
"driver" "mysql"
"host" "$DB_HOST"
"port" "$DB_PORT"
"database" "$DB_NAME"
"user" "$DB_USER"
"pass" "$DB_PASS"
}
}
EOF
fi
echo "--------------------------------------------------------------"
echo "Configured Shavit database connection"
echo "Host: $DB_HOST:$DB_PORT"
echo "Database: $DB_NAME"
echo "User: $DB_USER"
echo "--------------------------------------------------------------"
}
copy_64bit() {
@@ -114,8 +301,8 @@ run_cssds() {
}
main() {
# update_cssds
# update_tf2ds
update_cssds
update_tf2ds
copy_64bit
symlink_binaries
steamclient_binary
@@ -123,9 +310,66 @@ main() {
install_metamod
install_sourcemod
install_surf
configure_shavit_zones
configure_shavit_database
cfg
run_cssds
}
main
main
# sm plugins
# "vipmodel.smx" vipmodel.smx
# "Reserved Slots" (1.7.2) by AlliedModders LLC
# "ColoredText" (2.0) by unt0uch4bl3 for KSF use ONLY
# "Basic Ban Commands" (1.7.2) by AlliedModders LLC
# "Server Hop" (0.8.1) by [GRAVE] rig0r
# "PlayerTransmit" (1.0) by unt0uch
# "strippermodels.smx" strippermodels.smx
# "Whitelist" (1.0.0) by unt0uch4bl3
# "SMAC Anti-Speedhack" (0.8.0.9) by GoD-Tony
# "Player Commands" (1.4.0-dev) by AlliedModders LLC
# "sm_super_cmds_unt0uch.smx" sm_super_cmds_unt0uch.smx
# "Basic Chat" (1.7.2) by AlliedModders LLC
# "Admin File Reader" (1.7.2) by AlliedModders LLC
# "Name Change Punisher" (1.1) by Powerlord
# "Map Nominations" (1.7.2) by AlliedModders LLC
# "Stipper" (1.0) by unt0uch4bl3
# "No Block" (1.0.0.0) by sslice
# "Basic Votes" (1.7.2) by AlliedModders LLC
# "CMD Logger" (1.0.0) by unt0uch4bl3
# "Momentum surf fix '2" (1.1.5) by GAMMA CASE
# "Fun Commands" (1.4.0-dev) by AlliedModders LLC
# "Custom Votes" (0.5.6) by chundo
# "SurfTimer" (7.8.0) by unt0uch4bl3
# "Anti-Flood" (1.7.2) by AlliedModders LLC
# "EventQueue fix" (1.3.3) by carnifex
# "antibhop.smx" antibhop.smx
# "Basic Info Triggers" (1.4.2) by AlliedModders LLC
# "MapChooser" (1.7.2) by AlliedModders LLC
# "Admin Help" (1.4.0-dev) by AlliedModders LLC
# "Basic Respawn Plugin" (0.05) by Spyder
# "Rock The Vote" (1.7.2) by AlliedModders LLC
# "UrlOpen" (1.0) by unt0uch4bl3
# "Message Admin" by evolv
# "RandomCycle" (1.7.2) by AlliedModders LLC
# "PushFix - Definitive Edition" (1.1.0) by Original idea xutaxkamay | Implementation GAMMACASE
# "No-Jump Boost Fix" (1.0.0) by rio
# "Admin Menu" (1.7.2) by AlliedModders LLC
# "Client Preferences" (1.7.2) by AlliedModders LLC
# "Map configs" (1.1.1) by Berni
# "Nextmap" (1.5.1) by AlliedModders LLC
# "draw.smx" draw.smx
# "Player Trails" (3.0.2) by Twisted|Panda
# "Fun Votes" (1.7.2) by AlliedModders LLC
# "RNGFix" (1.1.3) by rio
# "SQL Admins (Threaded)" (1.7.2) by AlliedModders LLC
# "Surftimer Announcer" (1.0) by unt0uch4bl3
# "Basic Commands" (1.7.2) by AlliedModders LLC
# "DEMO Uploader" (1.0) by unt0uch4bl3
# "Players Votes" (1.5.0) by The Resident, pZv!
# "SMAC Command Monitor" (0.8.0.9) by GoD-Tony, psychonic, Kigen
# "Dissolve" (1.0.0.2) by L. Duke
# "SourceMod Anti-Cheat" (0.8.0.9) by GoD-Tony, psychonic