Просмотр исходного кода

Getting Quake live monitor and details working

Daniel Gibbs 10 лет назад
Родитель
Сommit
1596383554
3 измененных файлов с 74 добавлено и 2 удалено
  1. 2 2
      QuakeLive/qlserver
  2. 27 0
      functions/command_details.sh
  3. 45 0
      functions/info_config.sh

+ 2 - 2
QuakeLive/qlserver

@@ -26,8 +26,8 @@ steampass=""
 # Start Variables
 # Start Variables
 gameport="27960"
 gameport="27960"
 rconport="28960"
 rconport="28960"
-rcon_password='ch@ng3me'
-stats_password='ch@ng3me'
+rconpassword="ch@ng3me"
+statspassword="ch@ng3me"
 mappool='mappool.txt'
 mappool='mappool.txt'
 ip="0.0.0.0"
 ip="0.0.0.0"
 updateonstart="off"
 updateonstart="off"

+ 27 - 0
functions/command_details.sh

@@ -306,6 +306,31 @@ fi
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
+fn_details_id3tech(){
+echo -e ""
+echo -e "\e[92mPorts\e[0m"
+printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
+echo -e "Change ports by editing the parameters in"
+echo -e "${servercfgfullpath}."
+echo -e ""
+echo -e "Useful port diagnostic command:"
+echo -e "netstat -atunp | grep run_server"
+echo -e ""
+if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then
+	echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
+	echo -e ""
+fi
+{
+	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+	echo -e "> Game\tINBOUND\t${port}\tudp"
+	echo -e "> Rcon: Query\tINBOUND\t${rconport}\tudp"
+	echo -e "> Stats: Master traffic\tINBOUND\t${statsport}\tudp"
+} | column -s $'\t' -t 
+
+fn_details_statusbottom
+}
+
+
 fn_details_seriousengine35(){
 fn_details_seriousengine35(){
 echo -e ""
 echo -e ""
 echo -e "\e[92mPorts\e[0m"
 echo -e "\e[92mPorts\e[0m"
@@ -603,6 +628,8 @@ elif [ "${engine}" == "dontstarve" ]; then
 		fn_details_dontstarve
 		fn_details_dontstarve
 elif [ "${engine}" == "projectzomboid" ]; then
 elif [ "${engine}" == "projectzomboid" ]; then
 	fn_details_projectzomboid
 	fn_details_projectzomboid
+elif [ "${engine}" == "idtech3" ]; then
+	fn_details_idtech3
 elif [ "${engine}" == "realvirtuality" ]; then
 elif [ "${engine}" == "realvirtuality" ]; then
 	fn_details_realvirtuality
 	fn_details_realvirtuality
 elif [ "${engine}" == "seriousengine35" ]; then
 elif [ "${engine}" == "seriousengine35" ]; then

+ 45 - 0
functions/info_config.sh

@@ -154,6 +154,51 @@ elif [ "${engine}" == "projectzomboid" ]; then
 		port="0"
 		port="0"
 	fi
 	fi
 
 
+
+# Quake Live
+elif [ "${engine}" == "idtech3" ]; then
+
+	# server name
+	if [ -f "${servercfgfullpath}" ]; then
+		servername=$(grep "set sv_hostname " "${servercfgfullpath}" | sed 's/set sv_hostname //g' | tr -d '=\"; ')
+		if [ ! -n "${servername}" ]; then
+			servername="NOT SET"
+		fi
+	else
+		servername="\e[0;31mUNAVAILABLE\e[0m"
+	fi
+
+	# rcon password
+	rconpassword="${rconpassword}"
+	if [ -f "${servercfgfullpath}" ]; then
+		if [ ! -n "${rconpassword}" ]; then
+			rconpassword="NOT SET"
+		fi
+	else
+		rconpassword="\e[0;31mUNAVAILABLE\e[0m"
+	fi
+
+	# slots
+	if [ -f "${servercfgfullpath}" ]; then
+		slots=$(grep "set sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+		if [ ! -n "${slots}" ]; then
+			slots="NOT SET"
+		fi
+	else
+		slots="\e[0;31mUNAVAILABLE\e[0m"
+	fi
+
+	# port
+	port="${gameport}"
+	if [ ! -n "${port}" ]; then
+		port="0"
+	fi
+
+	# rcon port
+	if [ ! -n "${rconport}" ]; then
+		rconport="0"
+	fi
+
 # ARMA 3
 # ARMA 3
 elif [ "${engine}" == "realvirtuality" ]; then
 elif [ "${engine}" == "realvirtuality" ]; then