Skip to content
Permalink
Browse files

Ping.Format() change

Shorter, and now with colors
  • Loading branch information...
123DMWM committed Nov 20, 2017
1 parent 51ecc78 commit 1b58aea8c0f58cf19dd56a931a405d64b8c3c080
Showing with 5 additions and 4 deletions.
  1. +4 −3 fCraft/Commands/InfoCommands.cs
  2. +1 −1 fCraft/Network/PingList.cs
@@ -1760,7 +1760,8 @@ static void EmotesHandler(Player player, CommandReader cmd)
}

if (target != null && target.Ping.AveragePingMilliseconds() != 0) {
player.Message(target.Ping.Format());
player.Message("Ping: (&ALo&S:&7Med&S:&CHi&S)ms");
player.Message(" " + target.Ping.Format());
}
}

@@ -2084,9 +2085,9 @@ static void clpHandler(Player player, CommandReader cmd)
}

Player[] list = candidates.Skip(fixOffset(offset, candidates.Count())).Take(10).ToArray();
player.Message("Ping/Latency List:");
player.Message("Ping/Latency List: (&ALo&S:&7Med&S:&CHi&S)ms");
for (int i = 0; i < list.Length; i++) {
player.Message(" &7{1}&S - {0}", list[i].Info.ClassyName, list[i].Ping.Format());
player.Message(" {1}&S - {0}", list[i].Info.ClassyName, list[i].Ping.Format());
}
player.Message("Showing players {0}-{1} (out of {2}).", offset + 1, offset + list.Length, candidates.Count());
}
@@ -81,7 +81,7 @@ public struct PingEntry {
}

public string Format() {
return String.Format("Lowest ping {0}ms, average {1}ms, highest {2}ms",
return String.Format("&A{0}&S:&7{1}&S:&C{2}&T",
LowestPingMilliseconds(),
AveragePingMilliseconds(),
HighestPingMilliseconds());

0 comments on commit 1b58aea

Please sign in to comment.
You can’t perform that action at this time.