1
0
Fork 0

Merge pull request #1691 from tonibm19/patch-3

Added player count to webadmin
This commit is contained in:
Mattes D 2014-12-30 10:34:37 +01:00
commit 7a400bdcd1
1 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,7 @@ function ShowPage(WebAdmin, TemplateRequest)
SiteContent = {}
local BaseURL = WebAdmin:GetBaseURL(TemplateRequest.Request.Path)
local Title = "MCServer WebAdmin"
local NumPlayers = cRoot:Get():GetServer():GetNumPlayers()
local MemoryUsageKiB = cRoot:GetPhysicalRAMUsage()
local NumChunks = cRoot:Get():GetTotalChunkCount()
local PluginPage = WebAdmin:GetPage(TemplateRequest.Request)
@ -102,6 +103,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>