From 76879983ce11e2d021cea277d0d3e96447106a6a Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 16 Aug 2017 21:19:01 +1000 Subject: [PATCH] Output skin and model in /whois, fixes #284. (Thanks WolfgangNS) --- MCGalaxy/Database/Stats/OnlineStat.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MCGalaxy/Database/Stats/OnlineStat.cs b/MCGalaxy/Database/Stats/OnlineStat.cs index 843947947..f929e77ff 100644 --- a/MCGalaxy/Database/Stats/OnlineStat.cs +++ b/MCGalaxy/Database/Stats/OnlineStat.cs @@ -40,6 +40,7 @@ namespace MCGalaxy.DB { (p, who) => SpecialGroupLine(p, who.name), (p, who) => IPLine(p, who.name, who.ip), IdleLine, + EntityLine, }; static void OnlineCoreLine(Player p, Player who) { @@ -128,5 +129,18 @@ namespace MCGalaxy.DB { Player.Message(p, " Idle for {0}", idleTime.Shorten()); } } + + static void EntityLine(Player p, Player who) { + bool hasSkin = !p.SkinName.CaselessEq(p.truename); + bool hasModel = !(p.Model.CaselessEq("humanoid") || p.Model.CaselessEq("human")); + + if (hasSkin && hasModel) { + Player.Message(p, " Skin: &f{0} %S, model: &f{1}", p.SkinName, p.Model); + } else if (hasSkin) { + Player.Message(p, " Skin: &f{0}", p.SkinName); + } else if (hasModel) { + Player.Message(p, " Model: &f{0}", p.Model); + } + } } } \ No newline at end of file