config.lua 957 B

1234567891011121314151617181920212223242526272829
  1. ------------------------------------------------------------------------------
  2. -- This file is registered as reloadable.
  3. ------------------------------------------------------------------------------
  4. -- This file obtains options for the mod.
  5. if not minetest.global_exists("reload") then reload = {} end
  6. reload.impl = reload.impl or {}
  7. reload.impl.setting_get = function(setting)
  8. local str = minetest.settings:get(setting)
  9. if str and string.len(str) >= 2 then
  10. -- Strip quotes.
  11. str = string.gsub(str, "^\"", "")
  12. str = string.gsub(str, "\"$", "")
  13. end
  14. return str
  15. end
  16. -- Prefix for chat messages.
  17. reload.chat_prefix = reload.impl.setting_get("reload_chat_prefix") or "# Server: "
  18. -- Path to the root directory when executing arbitrary Lua files.
  19. -- Executing files outside this directory (via the chatcommands) is forbidden.
  20. -- Be sure to change this to suit your needs.
  21. reload.root_path = reload.impl.setting_get("reload_root_path") or "/home"