User:Nosoop/Guide/Game Server Configuration

From AlliedModders Wiki
< User:Nosoop/Guide
Revision as of 16:19, 3 September 2022 by Nosoop (talk | contribs) (Linux extension failing to load on outdated GLIBCXX_* version)
Jump to: navigation, search

Source Engine games often differ in configuration; here are some basic suggestions on how to set them up for either testing or production use.

General

The following section(s) apply to most, if not all games.

Fast Downloads

The Source Engine normally provides downloads over the same channel as gameplay, which is rather slow.

"Fast" downloads are downloads served out-of-band over HTTP, and as such you will need to have a web (HTTP) server up and running to take advantage of this functionality. This is highly recommended if you are running a server with any amount of custom content that a player needs to download (models, sounds, maps).

If you're using a game server provider, you may already have access to a web server for fast download purposes; check with your provider to confirm.

Examples of web servers include: nginx, Caddy, Apache, HFS, and many others (and many more not included in that list).

Once you have an HTTP server running, configure sv_downloadurl as follows:

sv_downloadurl "http://{your_server_location}/{path}";

The URL must be quoted, as // is treated as the start of a comment and if left unquoted, the rest of the line will be ignored. Do not include a trailing slash — the game client adds one when making the request; web servers are not guaranteed to collapse double slashes in the path.

{path} should be the path on your server that would translate to the root of your game server.

For example, if you have a file sound/my_server/fart.mp3 and an sv_downloadurl value of http://example.com/gameserverdownloads, the client will request http://example.com/gameserverdownloads/sound/my_server/fart.mp3 (and its BZip2-compressed equivalent).

You will need to also copy the files from the game server to the web server.

Linux extension failing to load on outdated GLIBCXX_* version

Older games (such as Counter Strike: Source and Day of Defeat: Source) tend to bundle outdated standard libraries, while some SourceMod extensions depend on newer versions. You can choose to do one of the following:

  • Remove bin/libstdc++.so.6 and bin/libgcc_s.so.1 relative to your game install directory (not the root of the filesytem); this will let the game load the system libraries.
  • If your operating system is also dated, you will need rebuild the extension using an older build environment, or upgrade to a newer one. If you plan on recompiling the extension, the Steam Runtime SDK should have libraries that are compatible with older systems.

Counter Strike: Global Offensive also bundles its own bin/libgcc_s.so.1; similar rules apply. You will need to remove both of those binaries for current versions of Metamod:Source and SourceMod to load.

SourceMod extension not loading

If no plugin depends on an extension, it won't be loaded automatically, nor will it show up in sm exts list. Use sm exts load ${extension} if you'd like to test if it loads, or add an ${extension}.autoload file (empty or not) in the extensions directory if you always want it to load.

Game Specific

Team Fortress 2

The Dedicated server configuration section on the Team Fortress 2 Official Wiki provides general configuration instructions. Depending on the platform you're working on, you may also be interested in the sections for Linux and Windows.

Mann vs. Machine

Set tf_mvm_min_players_to_start to 1 to only require one player to ready up and start the mission.

Steam Datagram Relay

The Steam Datagram Relay routes both server and client connections through the Steam network, hiding the IP address of each from each other.

Pass -enablefakeip in the server's launch options to enable. The server will then report "FakeIP allocation succeeded" at the end of startup; use that IP address in your game client to connect to the server. This allocation will change on every server startup.

Counter-Strike: Global Offensive

The Advanced Configuration section on the Valve Developer Wiki describes server configuration unique to CS:GO. It's different from most other mods.

Responsive server console when hibernating

Set sv_hibernate_ms to 0 to make the server console more responsive when no players are online.

Left 4 Dead 2

Disabling lobby system

While developing plugins, you generally don't want players being connected through Steam's lobby system. Add the following to server.cfg:

sv_allow_lobby_connect_only "0";
sv_password "password_to_connect_with";

Virtual Server Configuration

As a developer, you may need to test on multiple platforms. To avoid having another physical machine to work on, you can use virtualization to run an operating system on your desktop.

Virtualbox

Networking

Network Address Translation

With NAT plus port forwarding, the minimum would be to forward UDP from one of the host's loopback IP addresses to the server port on the VM's address. Forwarding TCP isn't necessary unless you are interested in using the RCON protocol.

For example, given a virtual machine with an IP address of 10.0.2.15 and the server listening on port 27015, you should configure NAT as follows:

  • 127.0.2.15:27015 (host) → 10.0.2.15:27015 (guest)

You can then connect to the server from the host OS by connecting to 127.0.2.15:27015.

Any loopback IP address on the host portion is acceptable to use (that is, any address starting with 127.*.*.*).

Host-Only Adapter

Enable the Host-Only Adapter on your VM and statically assign the address to be in the same network as your host operating system's adapter. This allows you to connect to the server without any additional networking complexities.