Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to allow for short competitive matches #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:<br/>

```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
Expand All @@ -18,37 +21,47 @@ $ 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:<br/>

```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:<br/>

```console
$ 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=normal
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).
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ services:
- SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E
- SRCDS_PORT=27015
- SRCDS_TV_PORT=27020
- MATCH_LENGTH=normal # Set normal for standard competitive and short for short match
- SCRIM=true # Set false for a team structured config
7 changes: 7 additions & 0 deletions entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down