From ffdf951ef2e88de8aeaa13efdee692ea1b8c6ecb Mon Sep 17 00:00:00 2001 From: iamtakingithard <84594011+iamtakingithard@users.noreply.github.com> Date: Thu, 14 Jul 2022 16:14:54 +0300 Subject: [PATCH] feat(newserver): Team Fortress 2 Classic --- .../config-lgsm/tf2cserver/_default.cfg | 188 ++++++++++++++++++ b/lgsm/functions/fix_tf2c.sh | 49 +++++ lgsm/data/serverlist.csv | 1 + lgsm/functions/core_functions.sh | 5 + lgsm/functions/fix.sh | 2 + lgsm/functions/install_config.sh | 7 + lgsm/functions/install_server_files.sh | 8 + 7 files changed, 260 insertions(+) create mode 100644 b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg create mode 100755 b/lgsm/functions/fix_tf2c.sh diff --git a/b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg b/b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg new file mode 100644 index 000000000..b4d984d01 --- /dev/null +++ b/b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg @@ -0,0 +1,188 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="pl_upward" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tf2classic -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="244310" # Source 2013 SDK +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Team Fortress 2 Classic" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/sfclassic" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/b/lgsm/functions/fix_tf2c.sh b/b/lgsm/functions/fix_tf2c.sh new file mode 100755 index 000000000..f1d552b88 --- /dev/null +++ b/b/lgsm/functions/fix_tf2c.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# LinuxGSM fix_tf2c.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Team Fortress 2 Classic. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" +fi + +if [ ! -f "${serverfiles}/bin/replay.so" ]; then + ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +fi + +if [ ! -f "${serverfiles}/bin/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +fi + +if [ ! -f "${serverfiles}/bin/soundemittersystem.so" ]; then + ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +fi + +if [ ! -f "${serverfiles}/bin/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index f5463cd84..b1f7bc616 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -105,6 +105,7 @@ sven,svenserver,Sven Co-op terraria,terrariaserver,Terraria tf2,tf2server,Team Fortress 2 tfc,tfcserver,Team Fortress Classic +tf2c,tf2cserver,Team Fortress 2 Classic ti,tiserver,The Isle ts,tsserver,The Specialists ts3,ts3server,Teamspeak 3 diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 29d2e2ebc..bd53af563 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -451,6 +451,11 @@ fix_tf2.sh() { fn_fetch_function } +fix_tf2c.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + fix_ut3.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 2d9af576e..21daad81d 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -75,6 +75,8 @@ if [ "${commandname}" != "INSTALL" ] && [ -z "${fixbypass}" ]; then fix_st.sh elif [ "${shortname}" == "tf2" ]; then fix_tf2.sh + elif [ "${shortname}" == "tf2c" ]; then + fix_tf2c.sh elif [ "${shortname}" == "terraria" ]; then fix_terraria.sh elif [ "${shortname}" == "ts3" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 597cc93c0..02f10a8f2 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -777,6 +777,13 @@ elif [ "${shortname}" == "tf2" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "tf2c" ]; then + gamedirname="TeamFortress2Classic" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then gamedirname="TeamFortressClassic" array_configs+=(server.cfg) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 395d48c68..48c580085 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -85,6 +85,14 @@ fn_install_server_files() { chmodx="nochmodx" run="norun" force="noforce" md5="7c664538999252eeaf2b6d9949416480" + elif [ "${shortname}" == "tf2c" ]; then + remote_fileurl="https://chapo.services/tf2c/tf2classic-2.0.3.zip" + local_filedir="${tmpdir}" + local_filename="tf2classic-2.0.3.zip" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="6f973d912ff2583d6b715ca624abe30a" elif [ "${shortname}" == "ns" ]; then remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz" local_filedir="${tmpdir}"