Daniel Gibbs 9 лет назад
Родитель
Сommit
79fe18d551
3 измененных файлов с 49 добавлено и 5 удалено
  1. 3 2
      Battlefield1942/bf1942server
  2. 13 3
      lgsm/functions/command_details.sh
  3. 33 0
      lgsm/functions/info_config.sh

+ 3 - 2
Battlefield1942/bf1942server

@@ -38,8 +38,8 @@ parms=" +hostServer 1 +dedicated 1"
 # Github Branch Select
 # Allows for the use of different function files
 # from a different repo and/or branch.
-githubuser="dgibbs64"
-githubrepo="linuxgsm"
+githubuser="GameServerManagers"
+githubrepo="LinuxGSM"
 githubbranch="master"
 
 # Server Details
@@ -60,6 +60,7 @@ systemdir="${filesdir}"
 executabledir="${systemdir}"
 executable="./start.sh"
 servercfg="serversettings.con"
+servercfgdefault="serversettings.con"
 servercfgdir="${systemdir}/mods/bf1942/settings"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 backupdir="${rootdir}/backups"

+ 13 - 3
lgsm/functions/command_details.sh

@@ -374,6 +374,16 @@ fn_details_realvirtuality(){
 	} | column -s $'\t' -t
 }
 
+fn_details_refractor(){
+	echo -e "netstat -atunp | grep bf1942_lnxd"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+		echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_details_idtech3(){
 	echo -e "netstat -atunp | grep qzeroded"
 	echo -e ""
@@ -599,7 +609,7 @@ fn_display_details() {
 		fn_details_commandlineparms
 	fi
 	fn_details_ports
-	
+
 	# Display details depending on game or engine.
 	if [ "${engine}" == "avalanche" ]; then
 		fn_details_avalanche
@@ -642,12 +652,12 @@ fn_display_details() {
 	else
 		fn_print_error_nl "Unable to detect server engine."
 	fi
-	
+
 	fn_details_statusbottom
 }
 
 if [ -z "${postdetails}" ] ;
-then 
+then
   fn_display_details
   core_exit.sh
 fi

+ 33 - 0
lgsm/functions/info_config.sh

@@ -41,6 +41,36 @@ fn_info_config_avalanche(){
 	fi
 }
 
+fn_info_config_bf1942(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		slots="${zero}"
+		port="${zero}"
+		queryport="${zero}"
+	else
+
+		servername=$(grep "game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs)
+		serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs)
+		slots=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
+		port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
+		queryport="22000"
+
+		# Not Set
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		slots=${slots:-"0"}
+		port=${port:-"0"}
+
+		# check if the ip exists in the config file. Failing this will fall back to the default.
+		ipconfigcheck=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs)
+		if [ -n "${ipconfigcheck}" ]; then
+			ip="${ipconfigcheck}"
+		fi
+	fi
+}
+
+
 fn_info_config_dontstarve(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
@@ -418,6 +448,9 @@ fn_info_config_sdtd(){
 # Just Cause 2
 if [ "${engine}" == "avalanche" ]; then
 	fn_info_config_avalanche
+# Battlefield: 1942
+elif [ "${gamename}" == "Battlefield: 1942" ]; then
+	fn_info_config_bf1942
 # Dont Starve Together
 elif [ "${engine}" == "dontstarve" ]; then
 	fn_info_config_dontstarve