summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-01-15 23:13:19 -0800
committerAuke Kok <auke-jan.h.kok@intel.com>2015-01-15 23:13:19 -0800
commit4246678ff325c4db2e6afe7b4732b5d770fb2cc9 (patch)
treefd6be05eb34e4ba3edfcb65ec1540c9a19e84f86 /init.lua
parent7eea34cb3e9098402a45366b4ceee9dfae4ad796 (diff)
Protect blocks command behind server privs. Add help.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index d0a488f..92fdd83 100644
--- a/init.lua
+++ b/init.lua
@@ -473,12 +473,19 @@ local function sedcmd(name, param)
"\ndegraded: " .. stat_degraded
return true, output
elseif paramlist[1] == "blocks" then
+ if not minetest.check_player_privs(name, {server=true}) then
+ return false, "You do not have privileges to execute that command"
+ end
if tonumber(paramlist[2]) then
count = tonumber(paramlist[2])
return true, "Set blocks to " .. count
else
return true, "Blocks: " .. count
end
+ else
+ return false, "/sed [blocks|stats|help]\n" ..
+ "blocks - get or set block count per interval (requires 'server' privs)\n" ..
+ "stats - display operational statistics"
end
return true, "Command completed succesfully"
end