From 12906c026d414c752d3c0ba9481f425b24b29c67 Mon Sep 17 00:00:00 2001 From: faketruth Date: Mon, 20 Aug 2012 12:20:20 +0000 Subject: Moved files used by MCServer to a special MCServer folder git-svn-id: http://mc-server.googlecode.com/svn/trunk@763 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/web_playerlist.lua | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 MCServer/Plugins/Core/web_playerlist.lua (limited to 'MCServer/Plugins/Core/web_playerlist.lua') diff --git a/MCServer/Plugins/Core/web_playerlist.lua b/MCServer/Plugins/Core/web_playerlist.lua new file mode 100644 index 000000000..b7e48cc3f --- /dev/null +++ b/MCServer/Plugins/Core/web_playerlist.lua @@ -0,0 +1,36 @@ +function HandleRequest_PlayerList( Request ) + local World = cRoot:Get():GetDefaultWorld() + local Content = "" + + if( Request.Params["playerlist-kick"] ~= nil ) then + local KickPlayerName = Request.Params["playerlist-kick"] + local Player = World:GetPlayer( KickPlayerName ) + if( Player == nil ) then + Content = Content .. "

Could not find player " .. KickPlayerName .. " !

" + elseif( Player:GetName() == KickPlayerName ) then + Player:GetClientHandle():Kick("You were kicked from the game!") + Content = Content .. "

" .. KickPlayerName .. " has been kicked from the game!

" + end + end + + Content = Content .. "

Connected Players: " .. World:GetNumPlayers() .. "

" + Content = Content .. "" + + local PlayerNum = 0 + local AddPlayerToTable = function( Player ) + PlayerNum = PlayerNum + 1 + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + end + World:ForEachPlayer( AddPlayerToTable ) + + if( PlayerNum == 0 ) then + Content = Content .. "" + end + Content = Content .. "
" .. PlayerNum .. "." .. Player:GetName() .. "Kick
None
" + Content = Content .. "
" + return Content +end \ No newline at end of file -- cgit v1.2.3