diff options
author | BremaWeb <brandon@bremaweb.com> | 2013-11-30 13:23:50 -0600 |
---|---|---|
committer | BremaWeb <brandon@bremaweb.com> | 2013-11-30 13:23:50 -0600 |
commit | 81a12e3d38c83eacfce4a3eeaec14724dcdb4c8f (patch) | |
tree | 58701772bd01e4ab332a0699cdcf0a3e0bf8e432 /config.lua | |
parent | 6b22f3d60f1b942485ccbb6dc5417fbe65119db9 (diff) |
restructured, use Settings interface for config, use protection API
Diffstat (limited to 'config.lua')
-rw-r--r-- | config.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/config.lua b/config.lua new file mode 100644 index 0000000..4c34102 --- /dev/null +++ b/config.lua @@ -0,0 +1,32 @@ +-- copied config section from technic +worldpath = minetest.get_worldpath() + +landrush.config = Settings(worldpath.."/landrush.conf") + +local conf_table = landrush.config:to_table() + +local defaults = { + requireClaim = "false", + onlineProtection = "true", + offenseDamage = "4", + autoBan = "false", + banLevel = "40", + banWarning = "25", + offenseReset = "1440", + adminUser = nil, + chunkSize = "16", + enableHud = "true" +} + +for k, v in pairs(defaults) do + if conf_table[k] == nil then + landrush.config:set(k, v) + end +end + +-- Create the config file if it doesn't exist +landrush.config:write() + +-- These are items that can be dug in unclaimed areas when landrush.config:get_bool("requireClaim") is true +landrush.global_dig_list = {["default:ladder"]=true,["default:leaves"]=true,["default:tree"]=true,["default:grass"]=true,["default:grass_1"]=true,["default:grass_2"]=true,["default:grass_3"]=true,["default:grass_4"]=true} + |