|
@ -13,7 +13,7 @@ default_privs = minetest.settings:get("switch_creative.default_privs") or "-crea |
|
|
|
|
|
|
|
|
function switch_creative:load_areas() |
|
|
function switch_creative:load_areas() |
|
|
self.astore:from_file(minetest.get_worldpath().."/switch_creative_areas") |
|
|
self.astore:from_file(minetest.get_worldpath().."/switch_creative_areas") |
|
|
-- local test = minetest.deserialize(mod_storage:get_string("astore")) |
|
|
switch_creative.area_privs = minetest.deserialize(mod_storage:get_string("astore_privs")) or {} |
|
|
-- local edge1 = { x=-10, y=-10, z=-10 } |
|
|
-- local edge1 = { x=-10, y=-10, z=-10 } |
|
|
-- local edge2 = { x=10, y=10, z=10 } |
|
|
-- local edge2 = { x=10, y=10, z=10 } |
|
|
-- local data = "Testarea" |
|
|
-- local data = "Testarea" |
|
@ -24,13 +24,12 @@ end |
|
|
|
|
|
|
|
|
function switch_creative:save_areas() |
|
|
function switch_creative:save_areas() |
|
|
self.astore:to_file(minetest.get_worldpath().."/switch_creative_areas") |
|
|
self.astore:to_file(minetest.get_worldpath().."/switch_creative_areas") |
|
|
-- local datastr = minetest.serialize(self.astore) |
|
|
local datastr = minetest.serialize(switch_creative.area_privs) |
|
|
-- if not datastr then |
|
|
if not datastr then |
|
|
-- minetest.log("error", "[switch_creative] Failed to serialize area data!") |
|
|
minetest.log("error", "[switch_creative] Failed to serialize area_privs data!") |
|
|
-- return |
|
|
return |
|
|
-- end |
|
|
end |
|
|
-- mod_storage:set_string("astore", datastr) |
|
|
mod_storage:set_string("astore", datastr) |
|
|
|
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
function switch_creative:set_area_privs(id, privs_string) |
|
|
function switch_creative:set_area_privs(id, privs_string) |
|
|