left4me/examples/script-overlays/tickrate.sh
mwiegand 196d2db33e
feat(l4d2-web): seed example script overlays from examples/script-overlays/
Bundles four reference script overlays (cedapug_maps, l4d2center_maps,
competitive_rework, tickrate) and adds a `flask seed-script-overlays`
CLI that upserts each *.sh as a system-wide overlay. Test deploy
invokes it after the orphan-cleanup migration so fresh test servers
come up with the same overlays the user has been maintaining by hand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 18:41:08 +02:00

25 lines
977 B
Bash

#!/bin/bash
# Tickrate overlay: server.cfg with high-rate settings + the tickrate_enabler
# addon (DLL/SO/VDF) from SirPlease/L4D2-Competitive-Rework.
# https://github.com/SirPlease/L4D2-Competitive-Rework/blob/7ecc3a32a5e2180d6607a40119ff2f3c072502a9/cfg/server.cfg#L58-L69
# https://www.programmersought.com/article/513810199514/
set -xeuo pipefail
CFG_DIR="$OVERLAY/left4dead2/cfg"
ADDONS_DIR="$OVERLAY/left4dead2/addons"
mkdir -p "$CFG_DIR" "$ADDONS_DIR"
cat <<'EOF' > "$CFG_DIR/server.cfg"
# https://github.com/SirPlease/L4D2-Competitive-Rework/blob/7ecc3a32a5e2180d6607a40119ff2f3c072502a9/cfg/server.cfg#L58-L69
sv_minrate 100000
sv_maxrate 100000
nb_update_frequency 0.014
net_splitpacket_maxrate 50000
net_maxcleartime 0.0001
fps_max 0
EOF
for file in tickrate_enabler.dll tickrate_enabler.so tickrate_enabler.vdf; do
curl -fsSL "https://github.com/SirPlease/L4D2-Competitive-Rework/raw/refs/heads/master/addons/${file}" \
-o "$ADDONS_DIR/${file}"
done