updated to work with minetest security - needed for loading binary code with loadfile

master
rnd1 2016-10-27 11:48:35 +02:00
parent df846e1375
commit 3f1a9af503
1 changed files with 5 additions and 2 deletions

View File

@ -17,7 +17,7 @@
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------
local cheat = {};
local version = "10/22/2016";
local version = "10/27/2016";
anticheatsettings = {};
dofile(minetest.get_modpath("anticheat").."/settings.lua")
@ -90,7 +90,10 @@ end
-- uncomment when obfuscating:
--dofile(minetest.get_modpath("anticheat").."/anticheat_source.lua")
local anticheat_routines=loadfile(minetest.get_modpath("anticheat").."/anticheat_routines.bin")
local ie = minetest.request_insecure_environment() or _G;
local anticheat_routines = ie.loadfile(minetest.get_modpath("anticheat").."/anticheat_routines.bin")
check_noclip, check_fly, check_player = anticheat_routines(minetest,cheat,CHECK_AGAIN,punish_cheat);