Skip to content

Commit

Permalink
sv_lan induced segfault and CS2_IP fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joedwards32 committed Nov 5, 2023
1 parent 47b8929 commit 2830f21
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ STEAMGUARD="" (Optional, Steam Guard key if enabled. Use your most

```dockerfile
CS2_SERVERNAME="changeme" (Set the visible name for your private server)
CS2_IP=0.0.0.0 (CS2 server listening IP address, 0.0.0.0 - all IP addresses on the local machine, empty - IP identified automatically)
CS2_IP="" (CS2 server listening IP address, 0.0.0.0 - all IP addresses on the local machine, empty - IP identified automatically)
CS2_PORT=27015 (CS2 server listen port tcp_udp)
CS2_RCON_PORT="" (Optional, use a simple TCP proxy to have RCON listen on an alternative port.
Useful for services like AWS Fargate which do not support mixed protocol ports.)
Expand Down
10 changes: 8 additions & 2 deletions bullseye/etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ cp /etc/server.cfg "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \
-e "s/{{SERVER_PW}}/${CS2_PW}/g" \
-e "s/{{SERVER_RCON_PW}}/${CS2_RCONPW}/g" \
-e "s/{{SERVER_LAN}}/${CS2_LAN}/g" \
-e "s/{{TV_ENABLE}}/${TV_ENABLE}/g" \
-e "s/{{TV_PORT}}/${TV_PORT}/g" \
-e "s/{{TV_AUTORECORD}}/${TV_AUTORECORD}/g" \
Expand Down Expand Up @@ -65,6 +64,12 @@ else
CS2_GAME_MODE_ARGS="+game_alias ${CS2_GAMEALIAS}"
fi

if [[ -z $CS2_IP ]]; then
CS2_IP_ARGS=""
else
CS2_IP_ARGS="-ip ${CS2_IP}"
fi

# Start Server

if [[ ! -z $CS2_RCON_PORT ]]; then
Expand All @@ -73,7 +78,7 @@ if [[ ! -z $CS2_RCON_PORT ]]; then
fi

eval "./cs2" -dedicated \
-ip "${CS2_IP}" -port "${CS2_PORT}" \
"${CS2_IP_ARGS}" -port "${CS2_PORT}" \
-console \
-usercon \
-maxplayers "${CS2_MAXPLAYERS}" \
Expand All @@ -82,6 +87,7 @@ eval "./cs2" -dedicated \
+map "${CS2_STARTMAP}" \
+rcon_password "${CS2_RCONPW}" \
+sv_password "${CS2_PW}" \
+sv_lan "${CS2_LAN}" \
"${CS2_ADDITIONAL_ARGS}"

# Post Hook
Expand Down
1 change: 0 additions & 1 deletion bullseye/etc/server.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Server Defaults

hostname "{{SERVER_HOSTNAME}}" // Set server hostname
sv_lan {{SERVER_LAN}} // If a server is a LAN server there is no heartbeat, no Steam authentication, and no non-class C addresses

// Passwords

Expand Down

0 comments on commit 2830f21

Please sign in to comment.