Procházet zdrojové kódy

Added Starbound query

Daniel Gibbs před 8 roky
rodič
revize
ca462e3bae

+ 7 - 2
lgsm/functions/command_monitor.sh

@@ -79,10 +79,15 @@ fn_monitor_tmux(){
 		fn_print_ok_eol_nl
 		fn_script_log_pass "Checking session: OK"
 		# runs gsquery check on game with specific engines.
-		local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark unity3d unreal unreal2 )
+		local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 )
 		for allowed_engine in "${allowed_engines_array[@]}"
 		do
-			if [ "${allowed_engine}" == "${engine}" ]; then
+			if [ "${allowed_engine}" == "starbound" ]; then
+				info_config.sh
+				if [ "${rconenabled}" == "true" ]; then
+					monitor_gsquery.sh
+				fi
+			elif [ "${allowed_engine}" == "${engine}" ]; then
 				monitor_gsquery.sh
 			fi
 		done

+ 1 - 1
lgsm/functions/gsquery.py

@@ -17,7 +17,7 @@ class PythonGSQ:
         self.server_response_timeout = 5
         self.default_buffer_length = 1024
         #
-        sourcequery=['madness','quakelive','realvirtuality','refractor','source','goldsource','spark','unity3d']
+        sourcequery=['madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
         idtech2query=['idtech3','quake','iw3.0']
         idtech3query=['idtech2','iw2.0']
         if self.option.engine in sourcequery:

+ 2 - 0
lgsm/functions/info_config.sh

@@ -455,6 +455,7 @@ fn_info_config_source(){
 fn_info_config_starbound(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
+		rconenabled="${unavailable}"
 		rconpassword="${unavailable}"
 		port="21025"
 		queryport="21025"
@@ -462,6 +463,7 @@ fn_info_config_starbound(){
 		maxplayers="8"
 	else
 		servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
 		queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')