summaryrefslogtreecommitdiffstats
path: root/Plugins/Core/web_playerlist.lua
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-30 17:47:26 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-30 17:47:26 +0100
commit9dfa0f1f15c413540e932a04e94419a8a3b37dcf (patch)
treec111ee0ad961aa365b2c681e486dae4ce7e09421 /Plugins/Core/web_playerlist.lua
parentMore cFile cleanup; removed old format writing for block entities (diff)
downloadcuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.gz
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.bz2
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.lz
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.xz
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.tar.zst
cuberite-9dfa0f1f15c413540e932a04e94419a8a3b37dcf.zip
Diffstat (limited to 'Plugins/Core/web_playerlist.lua')
-rw-r--r--Plugins/Core/web_playerlist.lua17
1 files changed, 10 insertions, 7 deletions
diff --git a/Plugins/Core/web_playerlist.lua b/Plugins/Core/web_playerlist.lua
index eeb9369c1..205306ba8 100644
--- a/Plugins/Core/web_playerlist.lua
+++ b/Plugins/Core/web_playerlist.lua
@@ -18,14 +18,17 @@ function HandleRequest_PlayerList( Request )
local PlayerList = World:GetAllPlayers()
- for i, Player in ipairs( PlayerList ) do
- Content = Content .. "<tr>"
- Content = Content .. "<td style='width: 10px;'>" .. i .. ".</td>"
- Content = Content .. "<td>" .. Player:GetName() .. "</td>"
- Content = Content .. "<td><a href='?playerlist-kick=" .. Player:GetName() .. "'>Kick</a></td>"
- Content = Content .. "</tr>"
+ if( #PlayerList > 0 ) then
+ for i, Player in ipairs( PlayerList ) do
+ Content = Content .. "<tr>"
+ Content = Content .. "<td style='width: 10px;'>" .. i .. ".</td>"
+ Content = Content .. "<td>" .. Player:GetName() .. "</td>"
+ Content = Content .. "<td><a href='?playerlist-kick=" .. Player:GetName() .. "'>Kick</a></td>"
+ Content = Content .. "</tr>"
+ end
+ else
+ Content = Content .. "<tr><td>None</td></tr>"
end
-
Content = Content .. "</table>"
Content = Content .. "<br>"
return Content