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

Added map rotation variable #1

Open
wants to merge 8 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
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM lanopsdev/gameserver-steamcmd:latest
MAINTAINER Thornton Phillis ([email protected])
LABEL MAINTAINER="Thornton Phillis ([email protected])"

# Env - Defaults

Expand All @@ -11,6 +11,8 @@ ENV SRCDS_REGION -1
ENV SRCDS_PURE 1
ENV SRCDS_MAP ctf_2fort
ENV SRCDS_LAN 0
ENV SRCDS_MAP_ROTATION mapcycle_default.txt
ENV SRCDS_CONFIG_FILE server.cfg

# Env - Server

Expand Down Expand Up @@ -38,6 +40,7 @@ RUN { \
echo 'quit'; \
} > /home/steam/tf2_update.txt
ADD resources/root/startServer.sh /home/steam/startServer.sh
ADD resources/root/metamod.vdf /home/steam/metamod.vdf

# Pre Load LanOps Server Configs

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ docker run -it --name "TF2" \
-e SRCDS_TOKEN=xxx \
-e SRCDS_LAN=0 \
-e SRCDS_RCONPW=default \
-e SRCDS_MAP_ROTATION=mapcycle_default.txt \
-e SRCDS_CONFIG_FILE=server.cfg \
-p 27015:27015 \
-p 27015:27015/udp \
lanopsdev/gameserver-tf2
Expand All @@ -24,9 +26,11 @@ docker run -it --name "TF2" \
-e SRCDS_MAP=ctf_2fort \
-e SRCDS_MAXPLAYERS=24 \
-e SRCDS_TOKEN=xxx \
-e SRCDS_MAP_ROTATION=mapcycle_default.txt \
-e SRCDS_CONFIG_FILE=server.cfg \
-p 27015:27015 \
-p 27015:27015/udp \
lanopsdev/gameserver-tf
lanopsdev/gameserver-tf2
```


Expand All @@ -41,4 +45,6 @@ docker run -it --name "TF2" \
* SRCDS_REGION - Server Region (Default -1)
* SRCDS_TOKEN - Server token from [http://steamcommunity.com/dev/managegameservers](http://steamcommunity.com/dev/managegameservers) - Required for Browser Broadcast
* SRCDS_LAN - Set Lan Server (Default 0)
* SRCDS_MAP - Starting Map (Default ctf_2fort)
* SRCDS_MAP - Starting Map (Default ctf_2fort)
* SRCDS_MAP_ROTATION - Select a map cycle (located in tf/cfg, default mapcycle_default.txt)
* SRCDS_CONFIG_FILE - Allow for selecting a different server config file (Default server.cfg)
4 changes: 4 additions & 0 deletions resources/root/metamod.vdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"Plugin"
{
"file" "../tf/addons/metamod/bin/server"
}
6 changes: 5 additions & 1 deletion resources/root/startServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ fi

# Update Base Config

export SRCDS_HOSTNAME="${SRCDS_HOSTNAME:-An Amazing CSGO Server}"
export SRCDS_HOSTNAME="${SRCDS_HOSTNAME:-An Amazing TF2 Server}"

sed -i 's/SERVER_NAME/'"$SRCDS_HOSTNAME"'/g' ${SRCDS_SRV_DIR}/tf/cfg/server.cfg
sed -i 's/RCON_PASSWORD/'"$SRCDS_RCONPW"'/g' ${SRCDS_SRV_DIR}/tf/cfg/server.cfg
sed -i 's/SV_PASSWORD/'"$SRCDS_PW"'/g' ${SRCDS_SRV_DIR}/tf/cfg/server.cfg
cp -f /home/steam/metamod.vdf ${SRCDS_SRV_DIR}/tf/cfg/addons/metamod.vdf

# Run Server

Expand All @@ -85,4 +86,7 @@ sed -i 's/SV_PASSWORD/'"$SRCDS_PW"'/g' ${SRCDS_SRV_DIR}/tf/cfg/server.cfg
+sv_setsteamaccount ${SRCDS_TOKEN} \
+sv_lan ${SRCDS_LAN} \
+map ${SRCDS_MAP} \
+mapcyclefile ${SRCDS_MAP_ROTATION} \
+randommap \
+servercfgfile ${SRCDS_CONFIG_FILE} \
+ip 0.0.0.0