From de293999872346271cdfb5dbecbad7f77362b83b Mon Sep 17 00:00:00 2001 From: faketruth Date: Fri, 27 Jan 2012 23:47:32 +0000 Subject: Converted entire Core plugin including WebAdmin interface to new plugin method/system/thingy and sexyfied it. Made some changes to WebAdmin to make the new plugins work Old plugins still work like they're supposed to Not all hooks have been programmed for the new plugins yet, this still needs to be done git-svn-id: http://mc-server.googlecode.com/svn/trunk@182 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/Core/web_playerlist.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Plugins/Core/web_playerlist.lua (limited to 'Plugins/Core/web_playerlist.lua') diff --git a/Plugins/Core/web_playerlist.lua b/Plugins/Core/web_playerlist.lua new file mode 100644 index 000000000..eeb9369c1 --- /dev/null +++ b/Plugins/Core/web_playerlist.lua @@ -0,0 +1,32 @@ +function HandleRequest_PlayerList( Request ) + local World = cRoot:Get():GetWorld() + local Content = "" + + if( Request.Params:get("playerlist-kick") ~= "" ) then + local KickPlayerName = Request.Params:get("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 PlayerList = World:GetAllPlayers() + for i, Player in ipairs( PlayerList ) do + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + Content = Content .. "" + end + + Content = Content .. "
" .. i .. "." .. Player:GetName() .. "Kick
" + Content = Content .. "
" + return Content +end \ No newline at end of file -- cgit v1.2.3