1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Implement script sandboxing for main menu

This commit is contained in:
sfan5 2024-11-03 16:53:01 +01:00
parent 1fd4e0b82d
commit ea4ae55e24
10 changed files with 146 additions and 126 deletions

View file

@ -11,11 +11,6 @@ end
core.async_event_handler = handle_job
function core.handle_async(func, parameter, callback)
-- Serialize function
local serialized_func = string.dump(func)
assert(serialized_func ~= nil)
-- Serialize parameters
local serialized_param = core.serialize(parameter)
@ -23,7 +18,7 @@ function core.handle_async(func, parameter, callback)
return false
end
local jobid = core.do_async_callback(serialized_func, serialized_param)
local jobid = core.do_async_callback(func, serialized_param)
core.async_jobs[jobid] = callback