Skip to content
Permalink
Browse files

Add protection support to Luacontrollers,

protection is ignored with protection_bypass_priv
  • Loading branch information
cheapie authored and Jeija committed May 17, 2016
1 parent 75308f7 commit 40487a65f47cd42595417ab434a9b5a97a496a3e
Showing with 6 additions and 1 deletion.
  1. +6 −1 mesecons_luacontroller/init.lua
@@ -508,10 +508,15 @@ local digiline = {
end
}
}
local function on_receive_fields(pos, form_name, fields)
local function on_receive_fields(pos, form_name, fields, sender)
if not fields.program then
return
end
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
minetest.record_protection_violation(pos, name)
return
end
reset(pos)
reset_meta(pos, fields.code)
local err = run(pos, {type="program"})

0 comments on commit 40487a6

Please sign in to comment.