diff options
author | tonibm19 <tonibm19@gmail.com> | 2014-12-29 20:21:57 +0100 |
---|---|---|
committer | tonibm19 <tonibm19@gmail.com> | 2014-12-29 20:21:57 +0100 |
commit | b621fb511f5048968434475e4ebc7f4d012626aa (patch) | |
tree | 9ea6cc40d1b2a9431f68fb39fd4ce4262f159501 /MCServer/webadmin | |
parent | Add make as a required program for *nix (diff) | |
download | cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.tar cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.tar.gz cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.tar.bz2 cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.tar.lz cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.tar.xz cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.tar.zst cuberite-b621fb511f5048968434475e4ebc7f4d012626aa.zip |
Diffstat (limited to 'MCServer/webadmin')
-rw-r--r-- | MCServer/webadmin/template.lua | 10 |
1 files changed, 10 insertions, 0 deletions
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) <div class="wrapper"> <ul class="menu top_links"> <li><a>Server Name: <strong>]] .. cRoot:Get():GetServer():GetServerID() .. [[</strong></a></li> + <li><a>Players online: <strong>]] .. NumPlayers .. [[</strong></a></li> <li><a>Memory: <strong>]] .. MemoryUsageKiB / 1024 .. [[MB</strong></a></li> <li><a>Chunks: <strong>]] .. NumChunks .. [[</strong></a></li> </ul> |