sql and zones working

This commit is contained in:
Nathan Rashleigh
2025-12-20 16:45:46 +11:00
parent b223c3afd3
commit 4dbaaf1ec5
22 changed files with 144 additions and 818 deletions
+66
View File
@@ -0,0 +1,66 @@
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
// 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
// Execute Banned Users //
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip
// Contact & Region //
sv_contact ntr@megastructure.games
sv_region 5
// Rcon Settings //
rcon_password changeme
sv_rcon_banpenalty 1440
sv_rcon_maxfailures 5
// Log Settings //
log on
sv_log_onefile 0
sv_logfile 1
sv_logbans 1
sv_logecho 1
// Rate Settings //
fps_max 600
sv_minrate 0
sv_maxrate 20000
sv_minupdaterate 66
sv_maxupdaterate 66
// Download Settings //
sv_allowupload 1
sv_allowdownload 1
net_maxfilesize 500
sv_cheats 0
sv_timeout 900
mp_idlemaxtime 60
mp_idledealmethod 2
// Communications //
sv_voiceenable 1
sv_alltalk 0
+42
View File
@@ -0,0 +1,42 @@
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"
# 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
ENV METAMOD_VERSION 1.12
ENV SOURCEMOD_VERSION 1.12
COPY . /home/steam/etc
CMD ["bash", "./etc/run.sh"]
+1
View File
@@ -0,0 +1 @@
/etc/mysql/conf.d/
Executable
+131
View File
@@ -0,0 +1,131 @@
#! /bin/bash
set -uxe
CSTRIKE="$CSSDS/cstrike"
update_cssds() {
cd $STEAMCMD
./steamcmd.sh +runscript "$HOME/etc/update_cssds.txt"
echo "--------------------------------------------------------------"
echo "CSS DS is up to date"
echo "--------------------------------------------------------------"
}
update_tf2ds() {
cd $STEAMCMD
./steamcmd.sh +runscript "$HOME/etc/update_tf2ds.txt"
echo "--------------------------------------------------------------"
echo "TF2 DS is up to date"
echo "--------------------------------------------------------------"
}
install_metamod() {
# is the metamod folder missing?
if [ ! -d "$CSTRIKE/addons/metamod" ]; then
LATESTMM=$(wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/mmsource-latest-linux)
wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/"${LATESTMM}" | tar xvzf - -C "$CSTRIKE"
echo "--------------------------------------------------------------"
echo "Installed MetaMod $METAMOD_VERSION"
echo "--------------------------------------------------------------"
fi
}
install_sourcemod() {
# Are we in a sourcemod container and is the sourcemod folder missing?
if [ ! -d "$CSTRIKE/addons/sourcemod" ]; then
LATESTSM=$(wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/sourcemod-latest-linux)
wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/"${LATESTSM}" | tar xvzf - -C "$CSTRIKE"
echo "--------------------------------------------------------------"
echo "Installed SourceMod $SOURCEMOD_VERSION"
echo "--------------------------------------------------------------"
fi
}
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"
echo "--------------------------------------------------------------"
echo "Installed InfluxTimer"
echo "--------------------------------------------------------------"
fi
if [ ! -d "$CSTRIKE/addons/sourcemod/scripting/momsurffix" ]; then
wget "https://influxtimer.com/dl/influx_2_surf.zip"
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 "--------------------------------------------------------------"
fi
}
copy_64bit() {
cp -a "$TF2DS/bin/linux64/libsteam_api.so" \
"$CSSDS/bin/linux64/."
cp -a "$TF2DS/srcds_linux64" "$TF2DS/srcds_run_64" \
"$CSSDS/."
}
symlink_binaries() {
cd "$CSSDS/bin/linux64"
for file in *_srv.so; do
echo "Symlinking \"$file\" to \"${file/_srv/}"
ln -nfs "$file" "${file/_srv/}"
done
}
steamclient_binary() {
echo "Looking for steamclient.so and symlinking it..."
local _steamclient64bit=$(find "$HOME" -type f -name 'steamclient.so' | grep "linux64" | head -n 1)
if [ ! -n $_steamclient64bit ]; then
echo "Could not locate 64-bit steamclient.so binary. Exiting..."
exit 1
fi
mkdir -p "$HOME/.steam/sdk64/" # srcds_linux64 looks for steamclient.so in this directory
ln -nfs "$_steamclient64bit" "$HOME/.steam/sdk64/steamclient.so"
ln -nfs "$_steamclient64bit" "$CSSDS/bin/linux64/steamclient.so"
}
cfg() {
cd
cp etc/cfg/server.cfg cssds/cstrike/cfg/
}
run_cssds() {
echo "ready to run"
cd "$CSSDS"
./srcds_run_64 -game cstrike \
-port "${SRCDS_PORT}" \
+maxplayers "${SRCDS_MAXPLAYERS}" \
+map "${SRCDS_STARTMAP}"
# -ip "${SRCDS_IP}"
}
main() {
# update_cssds
# update_tf2ds
copy_64bit
symlink_binaries
steamclient_binary
install_metamod
install_sourcemod
install_surf
cfg
run_cssds
}
main
+6
View File
@@ -0,0 +1,6 @@
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
force_install_dir /home/steam/cssds
login anonymous
app_update 232330 validate
quit
+6
View File
@@ -0,0 +1,6 @@
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
force_install_dir /home/steam/tf2ds
login anonymous
app_update 232250 validate
quit