Team Fortress 2 Classic
Team Fortress 2 Classic is a free mod of the 2007 game Team Fortress 2, developed by Eminoma and utilizing the Source engine.
Ports
Add an allocation on the node for each port.
- Game/rcon 27015
- SourceTV 27020
Image
- ghcr.io/ptero-eggs/steamcmd:ubuntu2404 ghcr.io/ptero-eggs/steamcmd:ubuntu_24.04
Panel features
- steam_disk_space
The Panel tells the user when SteamCMD does not have enough disk space.
Startup
The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.
6 variables
Startup command
./srcds_run -game tf2classic -console -port 27015 +map ctf_2fort +ip 0.0.0.0 -strictportbind -norestart -debug +maxplayers 24Dotted values come from the server settings. These values are examples.
The ID corresponding to the game to download and run using SRCDS.
SRCDS_APPIDUsers can see
required|in:244310
The name corresponding to the game to download and run using SRCDS.
SRCDS_GAMEUsers can see
required|in:tf2classic
The default map to use when starting the server.
SRCDS_MAPUsers can edit
required|regex:/^(\w{1,20})$/
Version of TF2C to download.
GAMEVERSIONUsers can edit
required|string|max:20
The maximum amount of players allowed on the server.
MAXPLAYERSUsers can edit
required|string|max:20
SRCDS_BETAIDUsers can see
required|string|max:20
Wings
- Stop command
- quit
- Running when the console shows
- gameserver Steam ID
Readme
Team Fortress 2 Classic
From their Website
Team Fortress 2 Classic is a re-imagining of the 2008-2009 era of the original Team Fortress 2, of which is what we consider the "Classic Era", featuring old features that were scrapped and worked upon, or new content such as new weapons and gamemodes.
Server Ports
TF2C servers require 1 port to be open, the SourceTV port can also be opened for spectators.
| Port | default |
|---|---|
| Game/rcon | 27015 |
| SourceTV | 27020 |
Changes
- Team Fortress 2 Classic: Update yolk and add required beta vars
· Daniel Barton · b4ad66d
- Add steamcmd based eggs
· Daniel Barton · 60ef9fb
Problem with this egg?
Open an issue on GitHub. Include your Panel and Wings versions.
Install script 86 lines bash in ghcr.io/ptero-eggs/installers:debian Show Hide
#!/bin/bash
# steamcmd Base Installation Script
#
# Server Files: /mnt/server
apt update
apt install -y zstd
## just in case someone removed the defaults.
if [[ "${STEAM_USER}" == "" ]] || [[ "${STEAM_PASS}" == "" ]]; then
echo -e "steam user is not set.\n"
echo -e "Using anonymous user.\n"
STEAM_USER=anonymous
STEAM_PASS=""
STEAM_AUTH=""
else
echo -e "user set to ${STEAM_USER}"
fi
## download and install steamcmd
cd /tmp
mkdir -p /mnt/server/steamcmd
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
mkdir -p /mnt/server/steamapps # Fix steamcmd disk write error when this folder is missing
cd /mnt/server/steamcmd
# SteamCMD fails otherwise for some reason, even running as root.
# This is changed at the end of the install process anyways.
chown -R root:root /mnt
export HOME=/mnt/server
## install game using steamcmd
./steamcmd.sh +force_install_dir /mnt/server +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) ${INSTALL_FLAGS} validate +quit ## other flags may be needed depending on install. looking at you cs 1.6
## set up 32 bit libraries
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
## set up 64 bit libraries
mkdir -p /mnt/server/.steam/sdk64
cp -v linux64/steamclient.so ../.steam/sdk64/steamclient.so
## download TF2C from website
cd /mnt/server
which unzip
L_V=$(curl -s https://wiki.tf2classic.com/kachemak/versions.json | jq -r '.versions | to_entries | max_by(.key | tonumber) | .value.file') # tf2classic-2.1.3.tar.zst
if [ -z "${GAMEVERSION}" ] || [ "${GAMEVERSION}" == "latest" ]; then
DOWNLOAD_URL="https://wiki.tf2classic.com/kachemak/$L_V"
else
DOWNLOAD_URL="https://wiki.tf2classic.com/kachemak/tf2classic-${GAMEVERSION}.tar.zst"
fi
# Check if the URL returns a 404 status code
if curl -s --head "$DOWNLOAD_URL" | head -n 1 | grep "404 Not Found" > /dev/null; then
echo "URL returned 404. Setting to alternative URL."
DOWNLOAD_URL="https://wiki.tf2classic.com/kachemak/$L_V"
fi
echo "Downloading tf2classic, This will take some time"
echo "Download URL is: ${DOWNLOAD_URL}"
curl -sSL -o tf2classic.tar.zst ${DOWNLOAD_URL}
#tar -xf tf2classic.tar.zst
tar --use-compress-program=unzstd -xvf tf2classic.tar.zst
rm -rf tf2classic.tar.zst
## fix issue /w symlink
cd /mnt/server/bin
ln -s vphysics_srv.so vphysics.so
ln -s studiorender_srv.so studiorender.so
ln -s soundemittersystem_srv.so soundemittersystem.so
ln -s shaderapiempty_srv.so shaderapiempty.so
ln -s scenefilecache_srv.so scenefilecache.so
ln -s replay_srv.so replay.so
ln -s materialsystem_srv.so materialsystem.so
cd /mnt/server/tf2classic/bin
## fix server as of 2.0.4 crashing on start
rm -rf server_srv.so
ln -s server.so server_srv.so
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"