فهرست منبع

feat: add installation and information for SteamCMD

- Added code to install SteamCMD if it is missing or the steamcmd directory is missing.
- Modified the check_steamcmd function to print a warning message if SteamCMD is not installed.
- Modified the info_game_dst function to retrieve additional information from server and cluster configuration files.
- Updated the installation script to display a bold header before installing SteamCMD.
Daniel Gibbs 2 سال پیش
والد
کامیت
df02b1fc42
3فایلهای تغییر یافته به همراه12 افزوده شده و 9 حذف شده
  1. 2 1
      lgsm/modules/core_steamcmd.sh
  2. 8 6
      lgsm/modules/info_game.sh
  3. 2 2
      lgsm/modules/install_steamcmd.sh

+ 2 - 1
lgsm/modules/core_steamcmd.sh

@@ -44,6 +44,7 @@ fn_check_steamcmd() {
 	# Only install if steamcmd package is missing or steamcmd dir is missing.
 	if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then
 		if [ "${commandname}" == "INSTALL" ]; then
+			echo -e "install SteamCMD"
 			fn_install_steamcmd
 		else
 			fn_print_warn_nl "SteamCMD is not installed"
@@ -51,7 +52,7 @@ fn_check_steamcmd() {
 			fn_install_steamcmd
 		fi
 	elif [ "${commandname}" == "INSTALL" ]; then
-		echo -en "SteamCMD is already installed"
+		echo -en "install SteamCMD"
 		fn_print_skip_eol_nl
 	fi
 }

+ 8 - 6
lgsm/modules/info_game.sh

@@ -434,18 +434,20 @@ fn_info_game_dodr() {
 # Filetype: ini
 fn_info_game_dst() {
 	if [ -f "${servercfgfullpath}" ]; then
-		fn_info_game_ini "port" "server_port"
-		fn_info_game_ini "steamauthport" "authentication_port"
-		fn_info_game_ini "steamport" "master_server_port"
+		fn_info_game_ini "port" "server_port" "${servercfgfullpath}"
+		fn_info_game_ini "shard" "name" "${servercfgfullpath}"
+		fn_info_game_ini "steamauthport" "authentication_port" "${servercfgfullpath}"
+		fn_info_game_ini "steamport" "master_server_port" "${servercfgfullpath}"
 	fi
 	if [ -f "${clustercfgfullpath}" ]; then
+		fn_info_game_ini "configip" "bind_ip" "${clustercfgfullpath}"
+		fn_info_game_ini "gamemode" "game_mode" "${clustercfgfullpath}"
+		fn_info_game_ini "masterport" "master_port" "${clustercfgfullpath}"
 		fn_info_game_ini "maxplayers" "max_players" "${clustercfgfullpath}"
 		fn_info_game_ini "servername" "cluster_name" "${clustercfgfullpath}"
 		fn_info_game_ini "serverpassword" "cluster_password" "${clustercfgfullpath}"
 		fn_info_game_ini "tickrate" "tick_rate" "${clustercfgfullpath}"
-		fn_info_game_ini "masterport" "master_port" "${clustercfgfullpath}"
-		fn_info_game_ini "gamemode" "game_mode" "${clustercfgfullpath}"
-		fn_info_game_ini "configip" "bind_ip" "${clustercfgfullpath}"
+
 	fi
 
 	cave="${cave:-"NOT SET"}"

+ 2 - 2
lgsm/modules/install_steamcmd.sh

@@ -8,7 +8,7 @@
 moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo -e ""
-echo -e "${lightyellow}Installing SteamCMD${default}"
-echo -e "================================="
+echo -e "${bold}${lightyellow}Installing SteamCMD${default}"
+echo -e "${bold}=================================${default}"
 fn_sleep_time
 check_steamcmd.sh