Skip to content

Commit

Permalink
refactor: improve consistency and readability of code
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
dgibbs64 committed Oct 1, 2023
1 parent 12de621 commit 59e7309
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lgsm/modules/command_dev_details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ done
# Output the missing server details if there are any.
if [ -n "$missing_details" ]; then
echo -e ""
echo -e "${lightgreen}Missing Server Details${default}"
echo -e "${bold}${lightyellow}Missing Server Details${default}"
fn_messages_separator
echo -e "${missing_details}"
fi
Expand Down
20 changes: 10 additions & 10 deletions lgsm/modules/command_dev_query_raw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ info_distro.sh
info_messages.sh

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

fn_install_resources() {
echo -e ""
echo -e "${lightyellow}Installing Default Resources${default}"
echo -e "${bold}${lightyellow}Installing Default Resources${default}"
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_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_sponsor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

fn_print_ascii_logo
echo -e "${lightyellow}Support LinuxGSM${default}"
echo -e "${bold}${lightyellow}Support LinuxGSM${default}"
fn_messages_separator
echo -e ""
echo -e "Been using LinuxGSM?"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/core_getopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn_opt_usage() {
echo -e "LinuxGSM - ${gamename} - Version ${version}"
echo -e "https://linuxgsm.com/${gameservername}"
echo -e ""
echo -e "${lightyellow}Commands${default}"
echo -e "${bold}${lightyellow}Commands${default}"
# Display available commands.
index="0"
{
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fi
if [ "${commandname}" == "INSTALL" ]; then
if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then
echo -e ""
echo -e "${lightyellow}Applying Post-Install Fixes${default}"
echo -e "${bold}${lightyellow}Applying Post-Install Fixes${default}"
fn_messages_separator
postinstall=1
fn_apply_fix "post install" "${shortname}"
Expand Down
9 changes: 0 additions & 9 deletions lgsm/modules/info_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

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.
fn_info_message_password_strip() {
if [ "${commandname}" != "DETAILS" ]; then
Expand Down

0 comments on commit 59e7309

Please sign in to comment.