Thoreatically, /who should be paginated now

Version is now its own command with a different permission.
This commit is contained in:
Lucas Nicodemus 2012-05-29 00:26:09 -06:00
parent 1673d004c0
commit 52aa90ff9a
2 changed files with 94 additions and 10 deletions

View file

@ -64,6 +64,7 @@ namespace TShockAPI
/// Used for some places where a list of players might be used.
/// </summary>
/// <returns>String of players seperated by commas.</returns>
[Obsolete("Use GetPlayers and manually create strings. This should never have been kept as far as actual functions go.")]
public string GetPlayers()
{
var sb = new StringBuilder();
@ -81,10 +82,38 @@ namespace TShockAPI
return sb.ToString();
}
/// <summary>
/// Returns a list of current players on the server
/// </summary>
/// <param name="includeIDs">bool includeIDs - whether or not the string of each player name should include ID data</param>
/// <returns>List of strings with names</returns>
public List<string> GetPlayers(bool includeIDs)
{
var players = new List<string>();
foreach (TSPlayer ply in TShock.Players)
{
if (ply != null && ply.Active)
{
if (includeIDs)
{
players.Add(ply.Name + " (IX: " + ply.Index + ", ID: " + ply.UserID + ")");
}
else
{
players.Add(ply.Name);
}
}
}
return players;
}
/// <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>
[Obsolete("Use GetPlayers and manually create strings. This should never have been kept as far as actual functions go.")]
public string GetPlayersWithIds()
{
var sb = new StringBuilder();