4
0
Эх сурвалжийг харах

fix(boserver): apply boserver.txt by copying it to config.txt (#5158)

The Ballistic Overkill server has no config file argument and always
reads serverfiles/config.txt, so boserver.txt was ignored. fix_bo.sh now
copies boserver.txt over config.txt before each start (validate resets
config.txt), the unused -configfile= start parameter is dropped, and
details/monitor read QueryPort from the config instead of assuming the
game port plus one.

Fixes #5157
Daniel Gibbs 2 өдөр өмнө
parent
commit
6568656a29

+ 1 - 1
lgsm/config-default/config-lgsm/boserver/_default.cfg

@@ -14,7 +14,7 @@
 gslt=""
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}"
+startparameters="-batchmode -nographics -dedicated"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 8 - 0
lgsm/modules/fix_bo.sh

@@ -8,3 +8,11 @@
 moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/BODS_Data/Plugins/x86_64"
+
+if [ -f "${servercfgfullpath}" ] && ! cmp -s "${servercfgfullpath}" "${serverfiles}/config.txt"; then
+	fixname="copy ${servercfg} to config.txt"
+	fn_fix_msg_start
+	cp -f "${servercfgfullpath}" "${serverfiles}/config.txt"
+	exitcode=$?
+	fn_fix_msg_end
+fi

+ 2 - 1
lgsm/modules/info_game.sh

@@ -367,12 +367,13 @@ fn_info_game_bo() {
 	if [ -f "${servercfgfullpath}" ]; then
 		fn_info_game_ini "maxplayers" "MaxPlayers"
 		fn_info_game_ini "port" "ServerPort"
+		fn_info_game_ini "queryport" "QueryPort"
 		fn_info_game_ini "servername" "ServerName"
 		fn_info_game_ini "serverpassword" "Password"
 	fi
 	maxplayers="${maxplayers:-"0"}"
 	port="${port:-"0"}"
-	queryport="$((port + 1))"
+	queryport="${queryport:-"$((port + 1))"}"
 	servername="${servername:-"NOT SET"}"
 	serverpassword="${serverpassword:-"NOT SET"}"
 }