From e0a5f50cce072f1fa9023694c2e3bf132c70bce8 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:10:53 +0000 Subject: [PATCH 1/8] test --- Dockerfile | 1 + resources/root/startServer.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index b557922..ff42dd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ 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 - Server diff --git a/resources/root/startServer.sh b/resources/root/startServer.sh index cd40325..3d193eb 100755 --- a/resources/root/startServer.sh +++ b/resources/root/startServer.sh @@ -85,4 +85,5 @@ 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} +ip 0.0.0.0 From ead61876fac9dbf1453fa4135c56d2b5821c6bd9 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:11:51 +0000 Subject: [PATCH 2/8] missed \ --- resources/root/startServer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/root/startServer.sh b/resources/root/startServer.sh index 3d193eb..53859ff 100755 --- a/resources/root/startServer.sh +++ b/resources/root/startServer.sh @@ -85,5 +85,5 @@ 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} + +mapcyclefile ${SRCDS_MAP_ROTATION} \ +ip 0.0.0.0 From 513740049f5231c353a452ef4bf807efff3d9b75 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:14:23 +0000 Subject: [PATCH 3/8] updated to include new variable --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 90ee867..edc0ee8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ docker run -it --name "TF2" \ -e SRCDS_TOKEN=xxx \ -e SRCDS_LAN=0 \ -e SRCDS_RCONPW=default \ + -e SRCDS_MAP_ROTATION=mapcycle_default.txt \ -p 27015:27015 \ -p 27015:27015/udp \ lanopsdev/gameserver-tf2 @@ -26,7 +27,7 @@ docker run -it --name "TF2" \ -e SRCDS_TOKEN=xxx \ -p 27015:27015 \ -p 27015:27015/udp \ - lanopsdev/gameserver-tf + lanopsdev/gameserver-tf2 ``` @@ -41,4 +42,5 @@ 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) \ No newline at end of file +* SRCDS_MAP - Starting Map (Default ctf_2fort) +* SRCDS_MAP_ROTATION - Select a map cycle (located in tf/cfg, default mapcycle_default.txt) From 982d26e3a6bf5ac04f3837174cc3167ef1e8545b Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:18:02 +0000 Subject: [PATCH 4/8] update --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index edc0ee8..32f88e1 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ 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 \ -p 27015:27015 \ -p 27015:27015/udp \ lanopsdev/gameserver-tf2 From 2d0b2df3a4c2896ff65868b0fa6f442070640067 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:28:53 +0000 Subject: [PATCH 5/8] Corrected CSGO to TF2 --- resources/root/startServer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/root/startServer.sh b/resources/root/startServer.sh index 53859ff..869d014 100755 --- a/resources/root/startServer.sh +++ b/resources/root/startServer.sh @@ -58,7 +58,7 @@ 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 From 04981daf070792a0a2e737d0330b1c3d711174a3 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:35:27 +0000 Subject: [PATCH 6/8] added server cfg option --- Dockerfile | 3 ++- README.md | 3 +++ resources/root/startServer.sh | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ff42dd3..abecf8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +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_MAP_ROTATION mapcycle_default.txt +ENV SRCDS_CONFIG_FILE server.cfg # Env - Server diff --git a/README.md b/README.md index 32f88e1..408e23b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ docker run -it --name "TF2" \ -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 @@ -26,6 +27,7 @@ docker run -it --name "TF2" \ -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-tf2 @@ -45,3 +47,4 @@ docker run -it --name "TF2" \ * SRCDS_LAN - Set Lan Server (Default 0) * 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) diff --git a/resources/root/startServer.sh b/resources/root/startServer.sh index 869d014..4b00888 100755 --- a/resources/root/startServer.sh +++ b/resources/root/startServer.sh @@ -86,4 +86,6 @@ sed -i 's/SV_PASSWORD/'"$SRCDS_PW"'/g' ${SRCDS_SRV_DIR}/tf/cfg/server.cfg +sv_lan ${SRCDS_LAN} \ +map ${SRCDS_MAP} \ +mapcyclefile ${SRCDS_MAP_ROTATION} \ + +randommap \ + +servercfgfile ${SRCDS_CONFIG_FILE} \ +ip 0.0.0.0 From d68435a799d09af580a34fbf494eebd82da252c8 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sat, 7 Mar 2020 23:36:18 +0000 Subject: [PATCH 7/8] Maintainer instruction is deprecated. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index abecf8f..91a9057 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM lanopsdev/gameserver-steamcmd:latest -MAINTAINER Thornton Phillis (Th0rn0@lanops.co.uk) +LABEL MAINTAINER="Thornton Phillis (Th0rn0@lanops.co.uk)" # Env - Defaults From 472d21b600aaa01ed6713f4bdb8e8e3e43090c29 Mon Sep 17 00:00:00 2001 From: gnomesenpai Date: Sun, 8 Mar 2020 00:15:20 +0000 Subject: [PATCH 8/8] added metamod VDF so MM and SM should work correctly --- Dockerfile | 1 + resources/root/metamod.vdf | 4 ++++ resources/root/startServer.sh | 1 + 3 files changed, 6 insertions(+) create mode 100644 resources/root/metamod.vdf diff --git a/Dockerfile b/Dockerfile index 91a9057..ae7c58e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,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 diff --git a/resources/root/metamod.vdf b/resources/root/metamod.vdf new file mode 100644 index 0000000..f77e56a --- /dev/null +++ b/resources/root/metamod.vdf @@ -0,0 +1,4 @@ +"Plugin" +{ + "file" "../tf/addons/metamod/bin/server" +} diff --git a/resources/root/startServer.sh b/resources/root/startServer.sh index 4b00888..a008def 100755 --- a/resources/root/startServer.sh +++ b/resources/root/startServer.sh @@ -63,6 +63,7 @@ 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