From f95aad258b66db86b5603b48cc76ce7235154885 Mon Sep 17 00:00:00 2001 From: Ryth Date: Tue, 15 Mar 2022 23:52:00 +0000 Subject: [PATCH 1/2] Updated to allow for short competitive matches --- README.md | 25 +++++++++++++++++++------ docker-compose.yml | 1 + entry.sh | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2ce6069..7abca2d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ A docker image for running a dedicated server for the game [CS:GO](https://blog.counter-strike.net/). Configured to use the [Get5](https://github.com/splewis/get5/) plugin alongside [Metamod:Source](https://www.sourcemm.net/) and [Sourcemod](https://www.sourcemod.net/) to host a quick setup scrim server. This is a modified version of [CM2Walki's](https://github.com/CM2Walki/CSGO) Dockerfile. # How to use this image + ## Simple usage (recommended) Clone this repository locally:
+ ```console $ git clone https://github.com/FragSoc/csgo-server-scrim.git ``` Create a new directory for the game installation: + ```console $ mkdir -p $(pwd)/csgo-data $ chmod 777 $(pwd)/csgo-data # Makes sure the directory is writeable by the unprivileged container user @@ -18,11 +21,13 @@ $ chmod 777 $(pwd)/csgo-data # Makes sure the directory is writeable by the unpr **Look at configuration section below for guidance.** Run docker-compose up:
+ ```console $ docker-compose up ``` Due to the config files needing to be generated by the plugin, you'll have to stop the container and start it again for the setup to complete:
+ ```console $ docker-compose up ``` @@ -30,25 +35,33 @@ $ docker-compose up **The container will automatically update the game on startup, so if there is a game update just restart the container.** # Configuration + ##Custom server settings Before you run the initial startup, you will need to edit the custom_server_template.cfg file within the same dirtectory. This will be used to overwrite the /cfg/server.cfg file each time the server starts. Should you wish to make any edits once the server has been created, you can do so using the below command and the server will use them once restarted: + ```console $ docker exec -it *CONTAINER_NAME* nano /home/steam/custom_server_template.cfg ``` ## Environment Variables -You can overwrite these values within the docker-compose file, below are the defaults: + +You can overwrite these values within the docker-compose file, below are the defaults: + ```dockerfile -SRCDS_PORT=27015 -SRCDS_TV_PORT=27020 -SRCDS_CLIENT_PORT=27005 -SRCDS_TOKEN=0 -METAMOD_VERSION=1.10 +SRCDS_PORT=27015 +SRCDS_TV_PORT=27020 +SRCDS_CLIENT_PORT=27005 +SRCDS_TOKEN=0 +MATCH_LENGTH=0 +METAMOD_VERSION=1.10 SOURCEMOD_VERSION=1.10 ``` + **If you edit the ports you will need to adjust these within the docker-compose file also.** + ## Additional config (to-do) + The image also contains a copy of the official ESL config files from [here](https://play.eslgaming.com/download/26251762/). You will need to disable the Get5 plugin however (to-do) If you want to learn more about configuring a CS:GO server check this [documentation](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Advanced_Configuration). diff --git a/docker-compose.yml b/docker-compose.yml index 9755602..f6a82b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,5 @@ services: - SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E - SRCDS_PORT=27015 - SRCDS_TV_PORT=27020 + - MATCH_LENGTH=0 # Set 0 for standard competitive and 32 for short match - SCRIM=true # Set false for a team structured config diff --git a/entry.sh b/entry.sh index 587736d..da76f68 100644 --- a/entry.sh +++ b/entry.sh @@ -61,6 +61,7 @@ bash "${STEAMAPPDIR}/srcds_run" -game "${STEAMAPP}" -console -autoupdate \ -maxplayers_override "14" \ +game_type "0" \ +game_mode "1" \ + +sv_game_mode_flags "${MATCH_LENGTH}" \ +mapgroup "mg_active" \ +map "de_mirage" \ +sv_region "3" \ From 71c6af2941aae8a423de330f509fb53a716fd80c Mon Sep 17 00:00:00 2001 From: Ryth Date: Wed, 16 Mar 2022 00:06:15 +0000 Subject: [PATCH 2/2] Altered changes to effect Get5 config instead --- README.md | 2 +- docker-compose.yml | 2 +- entry.sh | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7abca2d..00e5aff 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ SRCDS_PORT=27015 SRCDS_TV_PORT=27020 SRCDS_CLIENT_PORT=27005 SRCDS_TOKEN=0 -MATCH_LENGTH=0 +MATCH_LENGTH=normal METAMOD_VERSION=1.10 SOURCEMOD_VERSION=1.10 ``` diff --git a/docker-compose.yml b/docker-compose.yml index f6a82b3..2981542 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,5 +9,5 @@ services: - SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E - SRCDS_PORT=27015 - SRCDS_TV_PORT=27020 - - MATCH_LENGTH=0 # Set 0 for standard competitive and 32 for short match + - MATCH_LENGTH=normal # Set normal for standard competitive and short for short match - SCRIM=true # Set false for a team structured config diff --git a/entry.sh b/entry.sh index da76f68..0aa2b77 100644 --- a/entry.sh +++ b/entry.sh @@ -46,6 +46,13 @@ else sed -i -e 's/get5_kick_when_no_match_loaded "0"/get5_kick_when_no_match_loaded "1"/g' "${STEAMAPPDIR}/${STEAMAPP}/cfg/sourcemod/get5.cfg" fi +if [ $MATCH_LENGTH == 'short' ] +then + echo "Configuring for SHORT match" + # Alter values in Get5 config to be configured for short match + sed -i -e 's/mp_maxrounds 30/mp_maxrounds 16/g' "${STEAMAPPDIR}/${STEAMAPP}/cfg/get5/live.cfg" +fi + # Believe it or not, if you don't do this srcds_run shits itself cd ${STEAMAPPDIR} @@ -61,7 +68,6 @@ bash "${STEAMAPPDIR}/srcds_run" -game "${STEAMAPP}" -console -autoupdate \ -maxplayers_override "14" \ +game_type "0" \ +game_mode "1" \ - +sv_game_mode_flags "${MATCH_LENGTH}" \ +mapgroup "mg_active" \ +map "de_mirage" \ +sv_region "3" \