Merge branch 'general-devel' into accountgroupcupdate-hook
This commit is contained in:
commit
4cab985d0f
27 changed files with 1749 additions and 1049 deletions
|
|
@ -402,7 +402,7 @@ namespace TShockAPI
|
|||
{"serverversion", Main.versionNumber},
|
||||
{"tshockversion", TShock.VersionNum},
|
||||
{"port", TShock.Config.Settings.ServerPort},
|
||||
{"playercount", Main.player.Where(p => null != p && p.active).Count()},
|
||||
{"playercount", TShock.Utils.GetActivePlayerCount()},
|
||||
{"maxplayers", TShock.Config.Settings.MaxSlots},
|
||||
{"world", (TShock.Config.Settings.UseServerName ? TShock.Config.Settings.ServerName : Main.worldName)},
|
||||
{"uptime", (DateTime.Now - System.Diagnostics.Process.GetCurrentProcess().StartTime).ToString(@"d'.'hh':'mm':'ss")},
|
||||
|
|
@ -945,8 +945,8 @@ namespace TShockAPI
|
|||
[Token]
|
||||
private object PlayerList(RestRequestArgs args)
|
||||
{
|
||||
var activeplayers = Main.player.Where(p => null != p && p.active).ToList();
|
||||
return new RestObject() { { "players", string.Join(", ", activeplayers.Select(p => p.name)) } };
|
||||
var activeplayers = TShock.Players.Where(p => null != p && p.Active).Select(p => p.Name);
|
||||
return new RestObject() { { "players", string.Join(", ", activeplayers) } };
|
||||
}
|
||||
|
||||
[Description("Fetches detailed user information on all connected users, and can be filtered by specifying a key value pair filter users where the key is a field and the value is a users field value.")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue