From 1c363c77fb43919f25d76ea889cdd77cb8df5c1c Mon Sep 17 00:00:00 2001 From: 123DMWM Date: Thu, 23 Jul 2020 19:28:53 -0400 Subject: [PATCH] Update /ping all format Makes it a bit more human readable. --- MCGalaxy/Commands/CPE/CmdPing.cs | 4 ++-- MCGalaxy/Network/Utils/PingList.cs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MCGalaxy/Commands/CPE/CmdPing.cs b/MCGalaxy/Commands/CPE/CmdPing.cs index a04ccdd2d..9f1d8dd6b 100644 --- a/MCGalaxy/Commands/CPE/CmdPing.cs +++ b/MCGalaxy/Commands/CPE/CmdPing.cs @@ -39,12 +39,12 @@ namespace MCGalaxy.Commands.Chatting { } else { if (!CheckExtraPerm(p, data, 1)) return; Player[] players = PlayerInfo.Online.Items; - p.Message("Ping/latency list for online players:"); + p.Message("Ping/latency list for online players: (&ALo%S:&7Avg%S:&CHi%S)ms"); foreach (Player pl in players) { if (!Entities.CanSee(data, p, pl)) continue; if (pl.Ping.Measures() == 0) continue; - p.Message(pl.ColoredName + " %S- " + pl.Ping.Format()); + p.Message(pl.Ping.FormatAll() + " %S- " + pl.ColoredName); } } } diff --git a/MCGalaxy/Network/Utils/PingList.cs b/MCGalaxy/Network/Utils/PingList.cs index 8521dea48..3f9d263dc 100644 --- a/MCGalaxy/Network/Utils/PingList.cs +++ b/MCGalaxy/Network/Utils/PingList.cs @@ -107,5 +107,10 @@ namespace MCGalaxy.Network { return string.Format("Lowest ping {0}ms, average {1}ms, highest {2}ms", LowestPing(), AveragePing(), HighestPing()); } + + public string FormatAll() { + return string.Format(" &A{0}%S:&7{1}%S:&C{2}", + LowestPing(), AveragePing(), HighestPing()); + } } } \ No newline at end of file