Gaming Servers - LeandroTheDev/arch_linux GitHub Wiki

FastDL Source Games

FastDL is a way to server host additional mods and files for players

Host a http server inside your source game files

cd /home/user/*SourceGam*DedicatedServer/*game*
python3 -m http.server 27000

Open the ports 2700, and set some variables to your cfg

  • sv_downloadurl "http://127.0.0.1:27000" // Change the address to your public address
  • sv_allowdownload 1
  • sv_allowupload 1

Now players should receive the mods

  • IMPORTANT: don't host this http server inside your real folder, if you have sensitive data inside your addons folder like your database credentials, players will able to download it, my suggestion is to copy only the necessary files host in another location

No More Room in Hell

Changing cvars

If you need to change sv_bash_cost_per_sec or any variable, you can simple create a ruleset inside nmrih/rulesets/mutators/myconfig.txt

"Rulesset"
{
   "Name"   "MyConfig"
   "Author" "You"
   "Description"   "Custom Configurations"

   "Base"
   {
      sv_bash_cost_per_sec 0,
      sv_shove_cost_0
   }
}

Now you should add this mutator to be called when te server starts, go to nmrih/cfg/myconfig.cfg, and add the line:

// Example 1
sv_mutators myconfig
// Example 2
sv_mutators myconfig,myconfig2

When you run the server put the new cfg to be executed when launching

./srcds_run +exec myconfig.cfg

Left 4 Dead 2

L4D2 is a pretty old game and valve doens't care about it, trying to run it on last kernel and libraries will have some problems, example: steamclient not working, steamclient not downloading, steamclient not connecting to the lobby, wrong ELF class, etc etc etc, so because of that we unfurtunally need to use docker

  • Download docker sudo pacman -S docker
  • Base script to start
#!/bin/sh
trap 'docker stop l4d2versus && docker rm l4d2versus' EXIT

docker run --name l4d2versus it \
   --group-add $(id -g) \ # Add your currently user group to the docker image group
   --network host \ # Use your currently network system instead of the docker network
   -v $(pwd)/addons:/addons/ \ # In the same folder of this script, create a folder called addons, put the sourcemod or steam workshop items inside this, and the server will automatically load it
   -v $(pwd)/cfg/server.cfg:/cfg/server.cfg \ # The same as above but for server configurations
   -v $(pwd)/cfg/sourcemod:/cfg/sourcemod/ \ # If you have sourcemod installed
left4devops/l4d2 -port 27015 -secure +sv_gametypes versus +mp_gamemode versus +map "c5m1_waterfront versus" +sv_steamgroup 123 +sv_steam_group_exclusive 0 +sv_region -1 +sv_allow_lobby_connect_only 0 +sv_lan 0
  • You can put srcds parameters after left4devops/l4d2, for example: left4devops/l4d2 -unsecure
  • After creating the script you need to change the addons and cfg folder permissions
  • chmod 770 -R addons
  • chmod 770 -R cfg
  • You need to do that command every time you add something

  • Now the docker image can access the addons and cfg folders from the currently user
  • Run the script to automatically download the docker image and start the server
  • You can access the docker instance using: docker exec -it l4d2versus bash
  • To close the server: docker stop l4d2versus && docker rm l4d2versus