Dedicated Linux server extras
TF2 Classic SourceMod+Metamod Setup
Note: This guide was adapted and revised from a guide written by Raizo, the original of which can be found here: https://iraizo.github.io/tf2-classic-sourcemod-setup/
SourceMod+Metamod is powerful administrator tool for dedicated server owners and operators. SourceMod lets you add administrators easily based on SteamID, control and authenticate to the server securely and even add additional functionality to everyone on server like extended map voting functionality.
SourceMod isn’t necessarily drag-and-drop like supported SM games are such as live TF2 and CS:Source due to this simply being a mod built off of Source SDK 2013 with things like a different game name (tf2classic
), offsets, signatures, etc.
While the process of getting SM to work isn’t that hard, generic source server guides do not cover few unique factors that come with setting up fully working MM+SM for mods like TF2 Classic.
Prerequisites
This guide assumes you already have a dedicated Linux server running that can run without issues, if not lacking in additional components. If not you should follow this guide to setup your server first.
Getting SourceMod and MetaMod
Visit the Stable builds section of sourcemod.net and grab the latest Linux build. Download it to your server using wget/curl or to your machine and upload it to your server using SFTP:
If using Linux Server Terminal or SSH instead of SFTP, first navigate to your server tf2classic folder, following example location from Dedicated Server Setup Guide, you want to navigate to /opt/tf2classic/server/tf2classic/
first.
Then you can run wget to download SourceMod archive to your current directory:
$ wget https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6917-linux.tar.gz
This link may be outdated. You can check sourcemod downloads page for the newest version and copy URL of the newest build.
You’ll also need stable Metamod:Source. Download it with one of the ways you did.
$ wget https://mms.alliedmods.net/mmsdrop/1.11/mmsource-1.11.0-git1148-linux.tar.gz
you can now extract both inside your tf2classic folder (/opt/tf2classic/server/tf2classic/
)
$ tar -xf sourcemod-1.11.0-git6917-linux.tar.gz
$ tar -xf mmsource-1.11.0-git1148-linux.tar.gz
You can delete the archive files after the extracted files are in correct place.
$ rem sourcemod-1.11.0-git6917-linux.tar.gz
$ rem mmsource-1.11.0-git1148-linux.tar.gz
There is still few crucial steps before launching the server.
Replacing metamod.vdf
metamod.vdf
is necessary for your server to recognize the game. Since this is a mod, we need to use a web tool to generate a metamod.vdf file for us that points to tf2classic
.
You should navigate to your ~/server/tf2classic/addons/
, Following Dedicated Server Setup example, we should now navigate to: /opt/tf2classic/server/tf2classic/addons/
You can now delete metamod.vdf
and metamod_x64.vdf
in this directory. No need to back up these or anything.
Head over to sourcemm.net/vdf.
You’re going to leave the “Game:” blank, or as “—”. In the “Game Folder” box, enter tf2classic
.
If you, at least currently, do not have SFTP available on your game server, you can alternatively do everything from Command Line/SSH connection.
Make sure that you have navigated to your ../tf2classic/addons
directory (/opt/tf2classic/server/tf2classic/addons/
)
First create a metamod.vdf
file in this directory with following command:
$ touch metamod.vdf
Followed by opening the file in your favorite command line editor, nano
in this example:
$ nano metamod.vdf
And type in the following:
"Plugin" { "file" "../tf2classic/addons/metamod/bin/server" }
before saving and exitting.
Importing custom gamedata
To fix many functions of SourceMod when running under Team Fortress 2 Classic, we need to import custom gamedata.
Move first to work under ../server/tf2classic/
directory (/opt/tf2classic/server/tf2classic/
)
If you are working with Ubuntu Server, you might have git
program already installed. Try first the following command:
$ git clone https://github.com/Scags/TF2Classic-Tools.git
If you do not have git
, download this repo with wget directly:
$ wget https://github.com/Scags/TF2Classic-Tools/archive/master.zip
Then unzip it:
$ unzip master.zip
cd
into the directory, being either TF2Classic-Tools
or TF2Classic-Tools-master
depending on how you downloaded it.
Run the following command to copy sourcemod
directory to your server's addons
folder:
$ cp -r sourcemod/ ../addons/
Now we have the necessary gamedata for plugins and core SM and MM functions to work with TF2C.
Setting yourself as the “root” admin user.
To register yourself as an administrator on your server with SourceMod, we have to add people to admins_simple.ini
file.