From 1c554a8be12c785cbb1fa49aed4a1e821987febe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 12 Aug 2018 22:21:33 +0100 Subject: [PATCH] Details will now list if game server is on the Steam Master server (#1986) Details will list if game server is on the Steam Master server fixes #1847 --- lgsm/functions/info_distro.sh | 12 ++++++++++++ lgsm/functions/info_messages.sh | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 4842397e8..71e3aa33c 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -172,3 +172,15 @@ if [ -z "${extip}" ]; then fi fi fi + +# Steam Master Server - checks if detected by master server +if [ "${ip}" ] && [ "${port}" ]; then + if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "ql" ]; then + masterserver=$(${curlpath} -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + if [ "${steammaster}" == "1" ]; then + masterserver="true" + else + masterserver="false" + fi + fi +fi \ No newline at end of file diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index c3a8509f2..ebe44854d 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -71,7 +71,7 @@ fn_info_message_performance(){ } | column -s $'\t' -t echo -e "" { - echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached\t available${default}" + echo -e "${blue}Mem:\t${blue}total\tused\tfree\tcached\tavailable${default}" echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" } | column -s $'\t' -t @@ -287,6 +287,15 @@ fn_info_message_gameserver(){ echo -e "${blue}Map rotation:\t${default}${randommap}" fi + # Listed on Master Server + if [ "${masterserver}" ];then + if [ "${masterserver}" == "true" ];then + echo -e "${blue}Master Server:\t${green}${masterserver}${default}" + else + echo -e "${blue}Master Server:\t${red}${masterserver}${default}" + fi + fi + # Online status if [ "${status}" == "0" ]; then echo -e "${blue}Status:\t${red}OFFLINE${default}"