From da66780a569712c23ae4f2996cfb4608a9f9d69d Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 1 Apr 2016 20:02:19 -0400 Subject: copy all standard Dreambuilder mods in from the old subgame (exactly as last supplied there, updates to these mods will follow later) --- areas/settings.lua | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 areas/settings.lua (limited to 'areas/settings.lua') diff --git a/areas/settings.lua b/areas/settings.lua new file mode 100644 index 0000000..140a655 --- /dev/null +++ b/areas/settings.lua @@ -0,0 +1,43 @@ +local world_path = minetest.get_worldpath() + +areas.config = {} + +local function setting(tp, name, default) + local full_name = "areas."..name + local value + if tp == "boolean" then + value = minetest.setting_getbool(full_name) + elseif tp == "string" then + value = minetest.setting_get(full_name) + elseif tp == "position" then + value = minetest.setting_get_pos(full_name) + elseif tp == "number" then + value = tonumber(minetest.setting_get(full_name)) + else + error("Invalid setting type!") + end + if value == nil then + value = default + end + areas.config[name] = value +end + +-------------- +-- Settings -- +-------------- + +setting("string", "filename", world_path.."/areas.dat") + +-- Allow players with a privilege create their own areas +-- within the maximum size and number. +setting("boolean", "self_protection", false) +setting("string", "self_protection_privilege", "interact") +setting("position", "self_protection_max_size", {x=64, y=128, z=64}) +setting("number", "self_protection_max_areas", 4) +-- For players with the areas_high_limit privilege. +setting("position", "self_protection_max_size_high", {x=512, y=512, z=512}) +setting("number", "self_protection_max_areas_high", 32) + +-- legacy_table (owner_defs) compatibility. Untested and has known issues. +setting("boolean", "legacy_table", false) + -- cgit v1.2.3