From eb3d051cc7f37388b872d30eae031566d7e575ca Mon Sep 17 00:00:00 2001 From: fanyx Date: Wed, 26 Jun 2024 12:22:56 +0200 Subject: [PATCH] Try to determine WAN IP via ipify.org --- tmserver/GameData/Config/config.xml | 22 +++++++++++----------- tmserver/bin/eval_env.sh | 4 +++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tmserver/GameData/Config/config.xml b/tmserver/GameData/Config/config.xml index 9f656a8..560069e 100644 --- a/tmserver/GameData/Config/config.xml +++ b/tmserver/GameData/Config/config.xml @@ -15,13 +15,13 @@ User - + @SERVER_LOGIN@ @SERVER_LOGIN_PASSWORD@ @VALIDATION_KEY@ - + @SERVER_NAME@ @SERVER_COMMENT@ @@ -29,17 +29,17 @@ @MAX_PLAYERS@ @SERVER_PASSWORD@ - + 32 - + forced 0 - 50000 + 50000 True True - + 60000 0.5 @@ -56,27 +56,27 @@ False - + 512 8192 - + @FORCE_IP_ADDRESS@ @SERVER_PORT@ @SERVER_P2P_PORT@ 0 - + 600 5000 True - + - + @PACKMASK@ False diff --git a/tmserver/bin/eval_env.sh b/tmserver/bin/eval_env.sh index 990daaf..907a0ad 100755 --- a/tmserver/bin/eval_env.sh +++ b/tmserver/bin/eval_env.sh @@ -18,6 +18,8 @@ SERVER_PORT=${SERVER_PORT:-2350} && config+=( "SERVER_PORT" ) echo "INFO | SERVER_PORT: ${SERVER_PORT}" SERVER_P2P_PORT=${SERVER_P2P_PORT:-3450} && config+=( "SERVER_P2P_PORT" ) echo "INFO | SERVER_P2P_PORT: ${SERVER_P2P_PORT}" +FORCE_IP_ADDRESS=${FORCE_IP_ADDRESS:-${curl https://api.ipify.org}} && config += ( "FORCE_IP_ADDRESS" ) +echo "INFO | FORCE_IP_ADDRESS: ${FORCE_IP_ADDRESS}" SERVER_NAME=${SERVER_NAME:-Trackmania Server} && config+=( "SERVER_NAME" ) echo "INFO | SERVER_NAME: ${SERVER_NAME}" SERVER_COMMENT=${SERVER_COMMENT:-This is a Trackmania Server} && config+=( "SERVER_COMMENT" ) @@ -71,4 +73,4 @@ done for idx in "${!playlist[@]}"; do arg=${playlist[$idx]} sed -i -e "s/@$arg@/${!arg}/g" GameData/Tracks/MatchSettings/playlist.xml -done \ No newline at end of file +done