GE Lua Documentation

Press F to search!

importPersistentData

Definition


-- @/lua/ge/main.lua:820

function importPersistentData()
  if not be then return end
  local s = be.persistenceLuaData
  -- log('E', 'main', '>>>> persistent data imported: ' .. tostring(s))
  -- deserialize extensions first, so the extensions are loaded before they are trying to get deserialized
  local ok, data = pcall(deserialize, s)
  if not ok then
    log('E', 'main', 'Error importing persistent data: ' .. tostring(data))
    writeFile('persistentDataError.txt', s)
  else
    deserializePackages(data)
    if data then
      rawset(_G, 'levelLoaded', data.levelLoaded)
    end
  end
end

Callers

@/lua/vehicle/main.lua

function importPersistentData(s)
  --log('D', "default.importPersistentData", s)
@/lua/vehicle/beamstate.lua

  importPersistentData(save.luaState)
@/lua/ge/main.lua
  -- import state last
  importPersistentData()