From 4246678ff325c4db2e6afe7b4732b5d770fb2cc9 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 15 Jan 2015 23:13:19 -0800 Subject: Protect blocks command behind server privs. Add help. --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3