diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-01-15 23:13:19 -0800 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-01-15 23:13:19 -0800 |
commit | 4246678ff325c4db2e6afe7b4732b5d770fb2cc9 (patch) | |
tree | fd6be05eb34e4ba3edfcb65ec1540c9a19e84f86 /init.lua | |
parent | 7eea34cb3e9098402a45366b4ceee9dfae4ad796 (diff) |
Protect blocks command behind server privs. Add help.
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |