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

refactor: improve consistency and readability of code

- Changed the color of "Missing Server Details" to bold yellow
- Changed the color of "Query IP Addresses" to bold yellow
- Changed the color of "Game Server Ports" to bold yellow
- Changed the color of "SS Output" to bold yellow
- Changed the color of "Query Port - Raw Output" to bold yellow
- Changed the color of "Gamedig Raw Output" to bold yellow
- Changed the color of "gsquery Raw Output" to bold yellow
- Changed the color of "TCP Raw Output" to bold yellow
- Changed the color of "Game Port - Raw Output" to bold yellow
- Changed the color of "Steam Master Server Response" to bold yellow
- Updated commit message formatting for better readability
Daniel Gibbs 2 лет назад
Родитель
Сommit
59e7309418

+ 1 - 1
lgsm/modules/command_dev_details.sh

@@ -90,7 +90,7 @@ done
 # Output the missing server details if there are any.
 # Output the missing server details if there are any.
 if [ -n "$missing_details" ]; then
 if [ -n "$missing_details" ]; then
 	echo -e ""
 	echo -e ""
-	echo -e "${lightgreen}Missing Server Details${default}"
+	echo -e "${bold}${lightyellow}Missing Server Details${default}"
 	fn_messages_separator
 	fn_messages_separator
 	echo -e "${missing_details}"
 	echo -e "${missing_details}"
 fi
 fi

+ 10 - 10
lgsm/modules/command_dev_query_raw.sh

@@ -16,14 +16,14 @@ info_distro.sh
 info_messages.sh
 info_messages.sh
 
 
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}Query IP Addresses${default}"
+echo -e "${bold}${lightyellow}Query IP Addresses${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 for queryip in "${queryips[@]}"; do
 for queryip in "${queryips[@]}"; do
 	echo -e "${queryip}"
 	echo -e "${queryip}"
 done
 done
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}Game Server Ports${default}"
+echo -e "${bold}${lightyellow}Game Server Ports${default}"
 fn_messages_separator
 fn_messages_separator
 {
 {
 	echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}"
 	echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}"
@@ -183,18 +183,18 @@ fn_messages_separator
 } \
 } \
 	| column -s $'\t' -t
 	| column -s $'\t' -t
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}SS Output${default}"
+echo -e "${bold}${lightyellow}SS Output${default}"
 fn_messages_separator
 fn_messages_separator
 fn_info_message_ports
 fn_info_message_ports
 eval "${portcommand}"
 eval "${portcommand}"
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}Query Port - Raw Output${default}"
+echo -e "${bold}${lightyellow}Query Port - Raw Output${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 echo -e "PORT: ${port}"
 echo -e "PORT: ${port}"
 echo -e "QUERY PORT: ${queryport}"
 echo -e "QUERY PORT: ${queryport}"
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}Gamedig Raw Output${default}"
+echo -e "${bold}${lightyellow}Gamedig Raw Output${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 if [ ! "$(command -v gamedig 2> /dev/null)" ]; then
 if [ ! "$(command -v gamedig 2> /dev/null)" ]; then
@@ -210,7 +210,7 @@ for queryip in "${queryips[@]}"; do
 	echo "${gamedigraw}" | jq
 	echo "${gamedigraw}" | jq
 done
 done
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}gsquery Raw Output${default}"
+echo -e "${bold}${lightyellow}gsquery Raw Output${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 for queryip in "${queryips[@]}"; do
 for queryip in "${queryips[@]}"; do
@@ -222,7 +222,7 @@ for queryip in "${queryips[@]}"; do
 	"${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}"
 	"${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}"
 done
 done
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}TCP Raw Output${default}"
+echo -e "${bold}${lightyellow}TCP Raw Output${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 for queryip in "${queryips[@]}"; do
 for queryip in "${queryips[@]}"; do
@@ -238,10 +238,10 @@ for queryip in "${queryips[@]}"; do
 	fi
 	fi
 done
 done
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}Game Port - Raw Output${default}"
+echo -e "${bold}${lightyellow}Game Port - Raw Output${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}TCP Raw Output${default}"
+echo -e "${bold}${lightyellow}TCP Raw Output${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 for queryip in "${queryips[@]}"; do
 for queryip in "${queryips[@]}"; do
@@ -257,7 +257,7 @@ for queryip in "${queryips[@]}"; do
 	fi
 	fi
 done
 done
 echo -e ""
 echo -e ""
-echo -e "${lightgreen}Steam Master Server Response${default}"
+echo -e "${bold}${lightyellow}Steam Master Server Response${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}"
 echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}"

+ 1 - 1
lgsm/modules/command_install_resources_mta.sh

@@ -12,7 +12,7 @@ fn_firstcommand_set
 
 
 fn_install_resources() {
 fn_install_resources() {
 	echo -e ""
 	echo -e ""
-	echo -e "${lightyellow}Installing Default Resources${default}"
+	echo -e "${bold}${lightyellow}Installing Default Resources${default}"
 	fn_messages_separator
 	fn_messages_separator
 	fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash"
 	fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash"
 	fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}"
 	fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}"

+ 1 - 1
lgsm/modules/command_sponsor.sh

@@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 fn_firstcommand_set
 fn_firstcommand_set
 
 
 fn_print_ascii_logo
 fn_print_ascii_logo
-echo -e "${lightyellow}Support LinuxGSM${default}"
+echo -e "${bold}${lightyellow}Support LinuxGSM${default}"
 fn_messages_separator
 fn_messages_separator
 echo -e ""
 echo -e ""
 echo -e "Been using LinuxGSM?"
 echo -e "Been using LinuxGSM?"

+ 1 - 1
lgsm/modules/core_getopt.sh

@@ -169,7 +169,7 @@ fn_opt_usage() {
 	echo -e "LinuxGSM - ${gamename} - Version ${version}"
 	echo -e "LinuxGSM - ${gamename} - Version ${version}"
 	echo -e "https://linuxgsm.com/${gameservername}"
 	echo -e "https://linuxgsm.com/${gameservername}"
 	echo -e ""
 	echo -e ""
-	echo -e "${lightyellow}Commands${default}"
+	echo -e "${bold}${lightyellow}Commands${default}"
 	# Display available commands.
 	# Display available commands.
 	index="0"
 	index="0"
 	{
 	{

+ 1 - 1
lgsm/modules/fix.sh

@@ -79,7 +79,7 @@ fi
 if [ "${commandname}" == "INSTALL" ]; then
 if [ "${commandname}" == "INSTALL" ]; then
 	if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then
 	if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then
 		echo -e ""
 		echo -e ""
-		echo -e "${lightyellow}Applying Post-Install Fixes${default}"
+		echo -e "${bold}${lightyellow}Applying Post-Install Fixes${default}"
 		fn_messages_separator
 		fn_messages_separator
 		postinstall=1
 		postinstall=1
 		fn_apply_fix "post install" "${shortname}"
 		fn_apply_fix "post install" "${shortname}"

+ 0 - 9
lgsm/modules/info_messages.sh

@@ -7,15 +7,6 @@
 
 
 moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
-# Separator is different for details.
-fn_messages_separator() {
-	if [ "${commandname}" == "DETAILS" ]; then
-		printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-	else
-		echo -e "${bold}=================================${default}"
-	fi
-}
-
 # Removes the passwords form all but details.
 # Removes the passwords form all but details.
 fn_info_message_password_strip() {
 fn_info_message_password_strip() {
 	if [ "${commandname}" != "DETAILS" ]; then
 	if [ "${commandname}" != "DETAILS" ]; then