Add TSPlayer.ActivePlayers
This commit is contained in:
parent
4eebaf6c44
commit
17cfdc3a16
2 changed files with 13 additions and 1 deletions
|
|
@ -74,6 +74,18 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
public static readonly TSPlayer All = new TSPlayer("All");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of active players on the server.
|
||||
/// </summary>
|
||||
/// <returns>The number of active players on the server.</returns>
|
||||
public static ICollection<TSPlayer> ActivePlayers
|
||||
{
|
||||
get
|
||||
{
|
||||
return TShock.Players.Where(p => null != p && p.TPlayer.active) as ICollection<TSPlayer>;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds a TSPlayer based on name or ID
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue