-
Notifications
You must be signed in to change notification settings - Fork 0
Gaming Servers
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
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.cfgL4D2 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 for that we unfurtunally we need to use docker
- Download docker
sudo pacman -S docker - Base script to start
#!/bin/sh
trap 'docker stop l4d2versus && docker rm l4d2versus' EXIT
PORT=27015
docker run --name l4d2versus \
--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
-e NET_CON_PORT=17017 \ # Telnet connection to access the server instance
-e PORT=$PORT \ # Ingame ports
-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
-e HOSTNAME="Bla bla" \
-e REGION=-1 \
-e STEAM_GROUP=123 \
-e STEAM_GROUP_EXCLUSIVE=false \
-e DEFAULT_MAP=c5m1_waterfront \
-e DEFAULT_MODE=versus \
-e GAME_TYPES="versus" \
left4devops/l4d2
- You can put srcds parameters after
left4devops/l4d2, for example:left4devops/l4d2 -unsecure - After creating the scripts you need to change the addons and cfg folder permissions
- chmod 770 addons
- chmod 770 cfg
- 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 - You can access the server rcon using:
docker exec -it l4d2versus telnet localhost 17015 - To close the server:
docker stop l4d2versus && docker rm l4d2versus