diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index 4d3934da8..416657c4b 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -52,12 +52,21 @@ end +function GetTotalPlayers() + Players=0 + local EachPlayer = function(Player) + Players = Players + 1 + end + cRoot:Get():ForEachPlayer(EachPlayer) + return Players +end function ShowPage(WebAdmin, TemplateRequest) SiteContent = {} local BaseURL = WebAdmin:GetBaseURL(TemplateRequest.Request.Path) local Title = "MCServer WebAdmin" + local NumPlayers = GetTotalPlayers() local MemoryUsageKiB = cRoot:GetPhysicalRAMUsage() local NumChunks = cRoot:Get():GetTotalChunkCount() local PluginPage = WebAdmin:GetPage(TemplateRequest.Request) @@ -102,6 +111,7 @@ function ShowPage(WebAdmin, TemplateRequest)