code maybe confusing, but now using Packet.lua format

This commit is contained in:
2025-10-25 20:17:20 -03:00
parent ecce74d2e9
commit 820ffc299f
7 changed files with 413 additions and 68 deletions

View File

@@ -16,13 +16,10 @@ func GetSandBox() (lua.LState, error) {
osObject := L.GetGlobal("os").(*lua.LTable)
L.SetGlobal("SAFE_MODE", lua.LTrue)
L.SetGlobal("PACKETS_DATADIR", lua.LString(cfg.Config.Data_d))
L.SetGlobal("packets_bin_dir", lua.LString(cfg.Config.Bin_d))
L.SetGlobal("BIN_DIR", lua.LString(cfg.Config.Bin_d))
L.SetGlobal("path_join", L.NewFunction(Ljoin))
// Packets build functions
osObject.RawSetString("remove", L.NewFunction(LSafeRemove))
osObject.RawSetString("rename", L.NewFunction(LSafeRename))
osObject.RawSetString("copy", L.NewFunction(LSafeCopy))