Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Dedicated legacy Linux server extras: Difference between revisions

From TF2 Classified Wiki
Sumea (talk | contribs)
Created page with "''Note: This page's metamod+sourcemod installation 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/'' == Prerequisites == This guide assumes you already have a server running that can be connected and played on, albeit without any additional modifications. If not you should follow this guide to setup one. To reitorate: * A Linux server ru..."
 
Sumea (talk | contribs)
No edit summary
Line 1: Line 1:
''Note: This page's metamod+sourcemod installation 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/''


== Prerequisites ==
==TF2 Classic SourceMod+Metamod Setup==
This guide assumes you already have a server running that can be connected and played on, albeit without any additional modifications. If not you should follow [[Dedicated Linux server|this guide]] to setup one. To reitorate:
<small>''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/''</small>
* A Linux server running Ubuntu Server<sup>*</sup> on an x86_64 CPU. You cannot easily run SRCDS on any other architecture besides an x86_64 CPU. Box64/Box86 may work for ARM processors (e.g. Raspberry Pis) but that's complex, and not covered here.
* A SFTP/SSH client (PuTTY, Termius, FileZilla, MobaXterm)
* At least 16GB of free storage for base TF2 Classic installation<small><sup>2</sup></small>
* A minimum of a 10Mbps upload speed if you intend on hosting a server over the Internet. No need to worry for LAN servers.


''<small><sup>*</sup>This guide was written for and tested on Ubuntu Server 22.04 LTS, however any Debian-based distro should work similarly and fine using this guide. This page's editor's testing is based on Debian 11.</small>''
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.


''<small><sup>2</sup>More available space is required for custom content such as maps on your game server as well as HTTP/Fast Download server if you choose to use one.</small>''
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 (<code>tf2classic</code>), offsets, signatures, etc.


== TF2 Classic SourceMod+Metamod Setup ==
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.
So, as expected, SourceMod isn’t necessarily drag-and-drop like supported SM games are such as TF2 and CS:Source due to this simply being a mod built off of Source SDK 2013 with things like a different game name (<code>tf2classic</code>), 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 [[Dedicated Linux server|this guide]] to setup your server first.


== Getting SourceMod and MetaMod ==
=== Getting SourceMod and MetaMod ===
Visit the Stable builds section of [https://www.sourcemod.net/downloads.php?branch=stable 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:
Visit the Stable builds section of [https://www.sourcemod.net/downloads.php?branch=stable 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 Linux server|Dedicated Server Setup Guide]], you want to navigate to <code>/opt/tf2classic/server/tf2classic/</code> first.
If using Linux Server Terminal or SSH instead of SFTP, first navigate to your server tf2classic folder, following example location from [[Dedicated Linux server|Dedicated Server Setup Guide]], you want to navigate to <code>/opt/tf2classic/server/tf2classic/</code> first.


Then you can run wget
Then you can run wget to download SourceMod archive to your current directory:


<code><nowiki>$ wget https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6917-linux.tar.gz</nowiki></code>
<code><nowiki>$ wget https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6917-linux.tar.gz</nowiki></code>
Line 34: Line 29:
you can now extract both inside your tf2classic folder (<code>/opt/tf2classic/server/tf2classic/</code>)
you can now extract both inside your tf2classic folder (<code>/opt/tf2classic/server/tf2classic/</code>)


<code>tar -xf sourcemod-1.11.0-git6917-linux.tar.gz</code>
<code><nowiki>$</nowiki> tar -xf sourcemod-1.11.0-git6917-linux.tar.gz</code>


<code>tar -xf mmsource-1.11.0-git1148-linux.tar.gz</code>
<code><nowiki>$</nowiki> tar -xf mmsource-1.11.0-git1148-linux.tar.gz</code>


You can delete the archive files after the extracted files are in correct place.
You can delete the archive files after the extracted files are in correct place.
<code><nowiki>$</nowiki> rem sourcemod-1.11.0-git6917-linux.tar.gz</code>
<code><nowiki>$</nowiki> rem mmsource-1.11.0-git1148-linux.tar.gz</code>


There is still few crucial steps before launching the server.
There is still few crucial steps before launching the server.


== Replacing <code>metamod.vdf</code> ==
=== Replacing <code>metamod.vdf</code> ===
<code>metamod.vdf</code> 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 <code>tf2classic</code>.
<code>metamod.vdf</code> 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 <code>tf2classic</code>.


Line 50: Line 49:


Head over to [https://www.sourcemm.net/vdf sourcemm.net/vdf].
Head over to [https://www.sourcemm.net/vdf sourcemm.net/vdf].
You’re going to leave the “Game:” blank, or as “—”. In the “Game Folder” box, enter <code>tf2classic</code>. It should look exactly like this.
You’re going to leave the “Game:” blank, or as “—”. In the “Game Folder” box, enter <code>tf2classic</code>.
 
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 <code>../tf2classic/addons</code> directory (<code>/opt/tf2classic/server/tf2classic/addons/</code>)
 
First create a <code>metamod.vdf</code> file in this directory with following command:
 
<code><nowiki>$</nowiki> touch metamod.vdf</code>
 
Followed by opening the file in your favorite command line editor, <code>nano</code> in this example:
 
<code><nowiki>$</nowiki> nano metamod.vdf</code>
 
And type in the following:
 
<nowiki>"Plugin"
{
"file" "../tf2classic/addons/metamod/bin/server"
}</nowiki>
 
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.
<br>Move first to work under <code>../server/tf2classic/</code> directory  (<code>/opt/tf2classic/server/tf2classic/</code>)
 
If you are working with Ubuntu Server, you might have <code>git</code> program already installed. Try first the following command:
 
<code><nowiki>$</nowiki> git clone <nowiki>https://github.com/Scags/TF2Classic-Tools.git</nowiki></code>
 
If you do not have <code>git</code>, download this repo with wget directly:
 
<code><nowiki>$</nowiki> <nowiki>wget https://github.com/Scags/TF2Classic-Tools/archive/master.zip</nowiki></code>
 
Then unzip it:
 
<code><nowiki>$</nowiki> unzip master.zip</code>
 
<code>cd</code> into the directory, being either <code>TF2Classic-Tools</code> or <code>TF2Classic-Tools-master</code> depending on how you downloaded it.
<br>Run the following command to copy <code>sourcemod</code> directory to your server's <code>addons</code> folder:
 
<code><nowiki>$</nowiki> cp -r sourcemod/ ../addons/</code>
 
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 <code>admins_simple.ini</code> file.