Added permission for seeing ids when using /who

Also added in the ability to see ids when using /who.  Good for quickly adding ids to a region.
This commit is contained in:
Zack Piispanen 2012-01-26 19:41:12 -05:00
parent 174acade76
commit 1306043c00
3 changed files with 31 additions and 2 deletions

View file

@ -69,6 +69,29 @@ namespace TShockAPI
return sb.ToString();
}
/// <summary>
/// Used for some places where a list of players might be used.
/// </summary>
/// <returns>String of players and their id seperated by commas.</returns>
public string GetPlayersWithIds()
{
var sb = new StringBuilder();
foreach (TSPlayer player in TShock.Players)
{
if (player != null && player.Active)
{
if (sb.Length != 0)
{
sb.Append(", ");
}
sb.Append(player.Name);
string id = "( " + Convert.ToString(TShock.Users.GetUserID(player.UserAccountName)) + " )";
sb.Append(id);
}
}
return sb.ToString();
}
/// <summary>
/// Finds a player and gets IP as string
/// </summary>