From c142424571a3744e8b68ec9746eaa05505c03af5 Mon Sep 17 00:00:00 2001 From: faketruth Date: Tue, 31 Jan 2012 00:38:18 +0000 Subject: Can now receive POST data in WebPlugins! Fixed Debug With optimized Noise in VS2010 by having it run the correct MCServer_debug.exe instead of MCServer.exe Changed winsock.h to Winsock2.h in Globals.h so sockets can be graciously closed (See webserver Socket::Close() ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@197 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/Core/web_reload.lua | 4 ++-- Plugins/Core/web_whitelist.lua | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'Plugins/Core') diff --git a/Plugins/Core/web_reload.lua b/Plugins/Core/web_reload.lua index f78297fcb..45ed1a40b 100644 --- a/Plugins/Core/web_reload.lua +++ b/Plugins/Core/web_reload.lua @@ -1,12 +1,12 @@ function HandleRequest_Reload( Request ) local Content = "" - if( Request.Params:get("reload") ~= "" ) then + if( Request.PostParams:get("reload") ~= "" ) then Content = Content .. "" Content = Content .. "

Reloading plugins... This can take a while depending on the plugins you're using.

" cRoot:Get():GetPluginManager():ReloadPlugins() else - Content = Content .. "
" + Content = Content .. "" Content = Content .. "

Click the reload button to reload all plugins!
" Content = Content .. "

" Content = Content .. "
" diff --git a/Plugins/Core/web_whitelist.lua b/Plugins/Core/web_whitelist.lua index b7a220515..1a99a9f95 100644 --- a/Plugins/Core/web_whitelist.lua +++ b/Plugins/Core/web_whitelist.lua @@ -1,11 +1,11 @@ local function HTMLDeleteButton( name ) - return "
" + return "
" end function HandleRequest_WhiteList( Request ) local UpdateMessage = "" - if( Request.Params:get("whitelist-add") ~= "" ) then - local PlayerName = Request.Params:get("whitelist-add") + if( Request.PostParams:get("whitelist-add") ~= "" ) then + local PlayerName = Request.PostParams:get("whitelist-add") if( WhiteListIni:GetValueB("WhiteList", PlayerName, false) == true ) then UpdateMessage = "".. PlayerName.." is already on the whitelist" @@ -14,12 +14,12 @@ function HandleRequest_WhiteList( Request ) UpdateMessage = "Added " .. PlayerName .. " to whitelist." WhiteListIni:WriteFile() end - elseif( Request.Params:get("whitelist-delete") ~= "" ) then - local PlayerName = Request.Params:get("whitelist-delete") + elseif( Request.PostParams:get("whitelist-delete") ~= "" ) then + local PlayerName = Request.PostParams:get("whitelist-delete") WhiteListIni:DeleteValue( "WhiteList", PlayerName ) UpdateMessage = "Removed " .. PlayerName .. " from whitelist." WhiteListIni:WriteFile() - elseif( Request.Params:get("whitelist-reload") ~= "" ) then + elseif( Request.PostParams:get("whitelist-reload") ~= "" ) then WhiteListIni:Erase() -- Empty entire loaded ini first, otherwise weird shit goes down WhiteListIni:ReadFile() UpdateMessage = "Loaded from disk" @@ -63,10 +63,10 @@ function HandleRequest_WhiteList( Request ) end Content = Content .. "" Content = Content .. "

Add player to whitelist

" - Content = Content .. "
" + Content = Content .. "" Content = Content .. "" Content = Content .. "
" - Content = Content .. "
" + Content = Content .. "" Content = Content .. "" Content = Content .. "
" Content = Content .. "
"..UpdateMessage -- cgit v1.2.3