Merge pull request #56 from joedwards32/49-server-fails-to-start-in-docker-due-to-segmentation-fault

sv_lan induced segfault and CS2_IP fixes
This commit is contained in:
John Edwards 2023-11-05 21:11:18 +00:00 committed by GitHub
commit e26f942fb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -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.)

View file

@ -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" \
@ -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
@ -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}" \
@ -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

View file

@ -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