Remove os.shutdown, superseded by machine lib

This commit is contained in:
Alessandro Proto 2023-02-02 19:01:57 +01:00
parent c6858f6bc0
commit 732311a730

View file

@ -15,31 +15,5 @@ public class OS : IPlugin
public void LuaInit(Lua state) public void LuaInit(Lua state)
{ {
state.GetGlobal("os"); state.GetGlobal("os");
state.PushString("shutdown");
state.PushCFunction(L_Shutdown);
state.SetTable(-3);
}
private static int L_Shutdown(IntPtr state)
{
var L = Lua.FromIntPtr(state);
var doReboot = false;
if (L.IsBoolean(1))
{
doReboot = L.ToBoolean(1);
}
if (doReboot)
{
RuntimeManager.Reboot();
}
else
{
RuntimeManager.Shutdown();
}
return 0;
} }
} }