summaryrefslogtreecommitdiffstats
path: root/Plugins/Core
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-31 21:56:42 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-31 21:56:42 +0100
commit968f41ba511f8f74377b1a1c7b61ff759ebe3078 (patch)
treec52f95f94444254cd93e8e3460f7013eaab18b41 /Plugins/Core
parentSlight code cleanup, no big changes (diff)
downloadcuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.gz
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.bz2
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.lz
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.xz
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.tar.zst
cuberite-968f41ba511f8f74377b1a1c7b61ff759ebe3078.zip
Diffstat (limited to 'Plugins/Core')
-rw-r--r--Plugins/Core/web_playerlist.lua4
-rw-r--r--Plugins/Core/web_reload.lua2
-rw-r--r--Plugins/Core/web_whitelist.lua16
3 files changed, 11 insertions, 11 deletions
diff --git a/Plugins/Core/web_playerlist.lua b/Plugins/Core/web_playerlist.lua
index 205306ba8..6c736ce3c 100644
--- a/Plugins/Core/web_playerlist.lua
+++ b/Plugins/Core/web_playerlist.lua
@@ -2,8 +2,8 @@ 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")
+ if( Request.Params["playerlist-kick"] ~= nil ) then
+ local KickPlayerName = Request.Params["playerlist-kick"]
local Player = World:GetPlayer( KickPlayerName )
if( Player == nil ) then
Content = Content .. "<p>Could not find player " .. KickPlayerName .. " !</p>"
diff --git a/Plugins/Core/web_reload.lua b/Plugins/Core/web_reload.lua
index 45ed1a40b..3a59ad6b6 100644
--- a/Plugins/Core/web_reload.lua
+++ b/Plugins/Core/web_reload.lua
@@ -1,7 +1,7 @@
function HandleRequest_Reload( Request )
local Content = ""
- if( Request.PostParams:get("reload") ~= "" ) then
+ if( Request.PostParams["reload"] ~= nil ) then
Content = Content .. "<head><meta http-equiv=\"refresh\" content=\"2;././\"></head>"
Content = Content .. "<p>Reloading plugins... This can take a while depending on the plugins you're using.</p>"
cRoot:Get():GetPluginManager():ReloadPlugins()
diff --git a/Plugins/Core/web_whitelist.lua b/Plugins/Core/web_whitelist.lua
index 1a99a9f95..2c9ddb953 100644
--- a/Plugins/Core/web_whitelist.lua
+++ b/Plugins/Core/web_whitelist.lua
@@ -4,8 +4,8 @@ end
function HandleRequest_WhiteList( Request )
local UpdateMessage = ""
- if( Request.PostParams:get("whitelist-add") ~= "" ) then
- local PlayerName = Request.PostParams:get("whitelist-add")
+ if( Request.PostParams["whitelist-add"] ~= nil ) then
+ local PlayerName = Request.PostParams["whitelist-add"]
if( WhiteListIni:GetValueB("WhiteList", PlayerName, false) == true ) then
UpdateMessage = "<b>".. PlayerName.."</b> is already on the whitelist"
@@ -14,18 +14,18 @@ function HandleRequest_WhiteList( Request )
UpdateMessage = "Added <b>" .. PlayerName .. "</b> to whitelist."
WhiteListIni:WriteFile()
end
- elseif( Request.PostParams:get("whitelist-delete") ~= "" ) then
- local PlayerName = Request.PostParams:get("whitelist-delete")
+ elseif( Request.PostParams["whitelist-delete"] ~= nil ) then
+ local PlayerName = Request.PostParams["whitelist-delete"]
WhiteListIni:DeleteValue( "WhiteList", PlayerName )
UpdateMessage = "Removed <b>" .. PlayerName .. "</b> from whitelist."
WhiteListIni:WriteFile()
- elseif( Request.PostParams:get("whitelist-reload") ~= "" ) then
+ elseif( Request.PostParams["whitelist-reload"] ~= nil ) then
WhiteListIni:Erase() -- Empty entire loaded ini first, otherwise weird shit goes down
WhiteListIni:ReadFile()
UpdateMessage = "Loaded from disk"
- elseif( Request.Params:get("whitelist-setenable") ~= "" ) then
- local Enabled = Request.Params:get("whitelist-setenable");
- local CreateNewValue = false;
+ elseif( Request.Params["whitelist-setenable"] ~= nil ) then
+ local Enabled = Request.Params["whitelist-setenable"]
+ local CreateNewValue = false
if( WhiteListIni:FindValue( WhiteListIni:FindKey("WhiteListSettings"), "WhiteListOn" ) == cIniFile.noID ) then -- Find out whether the value is in the ini
CreateNewValue = true
end