diff --git a/README.md b/README.md index 0a36b50..b3841a7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ `GAMEMODE`: What gamemode to load. Not the same as the `game_mode` cvar. Value gets translated to a gamemode/gametype combination. Available values are: `casual`,`competitive`, `wingman`, `armsrace`, `deathmatch`, `custom`, `coop`, `dangerzone`, `weaponexpert`,`demolition`,`stab_zap`,`ffa`,`flying_scoutsman`,`trigger_discipline`,`headshots`,`hunter_gatherers`,`retakes`,`competitive_short`. For more information see [here](https://developer.valvesoftware.com/wiki/CS:GO_Game_Mode_Commands). +`MAP_ROTATION` comma separated list of maps to populate the `mapcycle.txt` and `maplist.txt` files. + # Custom conVars You can set ANY other variable by just prefixing the conVar with `CVAR_`. So for example if you want to set `mp_disable_autokick 1` just set the enviroment variable `CVAR_MP_DISABLE_AUTOKICK` to `1`. Upper or lower case is ignored. diff --git a/docker-compose.yml b/docker-compose.yml index fa6312c..7e9f0d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: - GAMEMODE=retakes - RCONPW=password123 - CVAR_MP_DISABLE_AUTOKICK=1 + - MAP_ROTATION=de_nuke,de_dust2,workshop/298621139/am_trainyard volumes: - csgo_game:/home/steam/server ports: diff --git a/entrypoint.sh b/entrypoint.sh index 3cd42b0..6c206a3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ set -eo pipefail -/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir /home/steam/server +app_update 740 +quit +/home/steam/steamcmd/steamcmd.sh +force_install_dir /home/steam/server +login anonymous +app_update 740 +quit if [ ! -e "$HOME/server/csgo/addons/metamod.vdf" ]; then @@ -17,6 +17,11 @@ if [ ! -e "$HOME/server/csgo/addons/metamod.vdf" ]; then rm /tmp/sourcemod.tar.gz fi +if [ -n "$MAP_ROTATION" ]; then + echo -n "$MAP_ROTATION" | sed 's/,/\n/g' | tee "$HOME/server/csgo/mapcycle.txt" "$HOME/server/csgo/maplist.txt" +else + echo -n "" | tee "$HOME/server/csgo/mapcycle.txt" "$HOME/server/csgo/maplist.txt" +fi SRCDS_ARGS="-usercon" @@ -37,6 +42,11 @@ if [ -n "$INSECURE" ]; then echo "Running with VAC disabled." fi +if [ -n "$NOMASTER" ]; then + SRCDS_ARGS="${SRCDS_ARGS} -nomaster" + echo "Running with nomaster." +fi + if [ -n "$MAX_PLAYERS" ]; then SRCDS_ARGS="${SRCDS_ARGS} -maxplayers $MAX_PLAYERS" echo "Maxplayers set to ${MAX_PLAYERS}."