Ver código fonte

Added Quake 3

Daniel Gibbs 9 anos atrás
pai
commit
31ff13993c
1 arquivos alterados com 23 adições e 0 exclusões
  1. 23 0
      lgsm/functions/info_config.sh

+ 23 - 0
lgsm/functions/info_config.sh

@@ -154,6 +154,26 @@ fn_info_config_projectzomboid(){
 	fi
 }
 
+fn_info_config_quake3(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		rconpassword="${unavailable}"
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		slots="${zero}"
+	else
+		rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		slots=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
+		# Not Set
+		rconpassword=${rconpassword:-"NOT SET"}
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		slots=${slots:-"0"}
+	fi
+}
+
 fn_info_config_quakelive(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		rconpassword="${unavailable}"
@@ -475,6 +495,9 @@ elif [ "${gamename}" == "Battlefield: 1942" ]; then
 # Dont Starve Together
 elif [ "${engine}" == "dontstarve" ]; then
 	fn_info_config_dontstarve
+# Quake 3
+elif [ "${gamename}" == "Quake 3: Arena" ]; then
+	fn_info_config_quake3
 # Quake Live
 elif [ "${gamename}" == "Quake Live" ]; then
 	fn_info_config_quakelive