public void Call(string name = null) { LuaSandbox.Sandbox(Lua, () => { _function.Call(name); }); }
public static LuaSandbox CreateSandbox(Lua thread, string initialDirectory) { var sandbox = new LuaSandbox(); SandboxForThread.Add(thread, sandbox); sandbox.SetSandboxCurrentDirectory(initialDirectory); return(sandbox); }
public static LuaSandbox CreateSandbox(Lua thread, string initialDirectory) { var sandbox = new LuaSandbox(); SandboxForThread.Add(thread, sandbox); sandbox.SetSandboxCurrentDirectory(initialDirectory); sandbox.SetLogger(DefaultLogger); return sandbox; }
public void DetachFromScript() { var thread = new Lua(); // Current dir will have to do for now, but this will inevitably not be desired // Users will expect it to be the same directly as the thread that spawned this callback // But how do we know what that directory was? LuaSandbox.CreateSandbox(thread, "."); LuaFile = new LuaFile(".") { Thread = thread }; }