Update /ping all format

Makes it a bit more human readable.
This commit is contained in:
123DMWM 2020-07-23 19:28:53 -04:00 committed by UnknownShadow200
parent 816d52b6ad
commit 1c363c77fb
2 changed files with 7 additions and 2 deletions

View File

@ -39,12 +39,12 @@ namespace MCGalaxy.Commands.Chatting {
} else { } else {
if (!CheckExtraPerm(p, data, 1)) return; if (!CheckExtraPerm(p, data, 1)) return;
Player[] players = PlayerInfo.Online.Items; 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) { foreach (Player pl in players) {
if (!Entities.CanSee(data, p, pl)) continue; if (!Entities.CanSee(data, p, pl)) continue;
if (pl.Ping.Measures() == 0) continue; if (pl.Ping.Measures() == 0) continue;
p.Message(pl.ColoredName + " %S- " + pl.Ping.Format()); p.Message(pl.Ping.FormatAll() + " %S- " + pl.ColoredName);
} }
} }
} }

View File

@ -107,5 +107,10 @@ namespace MCGalaxy.Network {
return string.Format("Lowest ping {0}ms, average {1}ms, highest {2}ms", return string.Format("Lowest ping {0}ms, average {1}ms, highest {2}ms",
LowestPing(), AveragePing(), HighestPing()); LowestPing(), AveragePing(), HighestPing());
} }
public string FormatAll() {
return string.Format(" &A{0}%S:&7{1}%S:&C{2}",
LowestPing(), AveragePing(), HighestPing());
}
} }
} }