From 10719e86a47cbac091ee6c1907cb151183e797a7 Mon Sep 17 00:00:00 2001 From: Adam Dehart Date: Wed, 25 Jan 2012 08:40:00 -0600 Subject: [PATCH] Added group display to /ui, /ui /kick /ban shows matching player names --- TShockAPI/Commands.cs | 48 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 5a81c44b..ffea76db 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -693,12 +693,24 @@ namespace TShockAPI var players = TShock.Utils.FindPlayer(args.Parameters[0]); if (players.Count > 1) { - args.Player.SendMessage("More than one player matched your query.", Color.Red); + var plrMatches = ""; + foreach (TSPlayer plr in players) + { + if (plrMatches.Length != 0) + { + plrMatches += ", " + plr.Name; + } + else + { + plrMatches += plr.Name; + } + } + args.Player.SendMessage("More than one player matched! Matches: " + plrMatches, Color.Red); return; } try { - args.Player.SendMessage("IP Address: " + players[0].IP + " Logged In As: " + players[0].UserAccountName, Color.Green); + args.Player.SendMessage("IP Address: " + players[0].IP + " Logged In As: " + players[0].UserAccountName + "Group: " + players[0].Group.Name, Color.Green); } catch (Exception) { @@ -727,8 +739,20 @@ namespace TShockAPI } else if (players.Count > 1) { - args.Player.SendMessage("More than one player matched!", Color.Red); - } + var plrMatches = ""; + foreach (TSPlayer plr in players) + { + if (plrMatches.Length != 0) + { + plrMatches += ", " + plr.Name; + } + else + { + plrMatches += plr.Name; + } + } + args.Player.SendMessage("More than one player matched! Matches: " + plrMatches, Color.Red); + } else { string reason = args.Parameters.Count > 1 @@ -762,8 +786,20 @@ namespace TShockAPI } else if (players.Count > 1) { - args.Player.SendMessage("More than one player matched!", Color.Red); - } + var plrMatches = ""; + foreach (TSPlayer plr in players) + { + if (plrMatches.Length != 0) + { + plrMatches += ", " + plr.Name; + } + else + { + plrMatches += plr.Name; + } + } + args.Player.SendMessage("More than one player matched! Matches: " + plrMatches, Color.Red); + } else { string reason = args.Parameters.Count > 1