فهرست منبع

Add missing functionality for terraria details

Bryce Van Dyk 10 سال پیش
والد
کامیت
375adb7f48
2فایلهای تغییر یافته به همراه11 افزوده شده و 3 حذف شده
  1. 1 3
      functions/fn_details
  2. 10 0
      functions/fn_details_config

+ 1 - 3
functions/fn_details

@@ -512,7 +512,7 @@ echo -e ""
 echo -e "\e[92mPorts\e[0m"
 echo -e "\e[92mPorts\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 echo -e "Change ports by editing the command-line"
 echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${selfname}."
+echo -e "parameters in ${servercfgfullpath}."
 echo -e ""
 echo -e ""
 echo -e "Useful port diagnostic command:"
 echo -e "Useful port diagnostic command:"
 echo -e "netstat -atunp | grep terraia"
 echo -e "netstat -atunp | grep terraia"
@@ -520,8 +520,6 @@ echo -e ""
 {
 {
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
-	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
-	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
 } >> .fn_details_ports
 } >> .fn_details_ports
 column -s $'\t' -t .fn_details_ports
 column -s $'\t' -t .fn_details_ports
 rm -f .fn_details_ports
 rm -f .fn_details_ports

+ 10 - 0
functions/fn_details_config

@@ -382,6 +382,16 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then
 		fileport="30033"
 		fileport="30033"
 	fi
 	fi
 
 
+elif [ "${engine}" == "terraria" ]; then
+
+	# port
+	if [ -f "${servercfgfullpath}" ]; then
+		port=$(grep "port=" "${servercfgfullpath}" | tr -cd "[:digit:]")
+	fi
+	if [ ! -n "${port}" ]; then
+		port="0"
+	fi
+
 elif [ "${engine}" == "unity3d" ]; then
 elif [ "${engine}" == "unity3d" ]; then
 
 
 	# server name
 	# server name