recreate settings as needed

This commit is contained in:
arpruss 2015-09-27 18:35:14 -05:00
parent e5d6cb74d7
commit f4c43255f8
2 changed files with 22 additions and 5 deletions

View File

@ -38,10 +38,27 @@ default_player_id = -1
world_immutable = false
local settings = Settings(mypath .. path_separator .. "settings.conf")
local update_settings = false
python_interpreter = settings:get("python")
if not python_interpreter then python_interpreter = "python" end
local local_only = settings:get_bool("local_only")
if python_interpreter == nil then
python_interpreter = "python"
update_settings = true
settings:set("python", python_interpreter)
end
local local_only = settings:get_bool("restrict_to_local_connections")
if local_only == nil then
local_only = false
update_settings = true
settings:set("restrict_to_local_connections", tostring(local_only))
end
local ws = settings:get_bool("support_websockets")
if ws == nil then
ws = false
update_settings = true
settings:set("support_websockets", tostring(ws))
end
if update_settings then settings:write() end
local remote_address
if local_only then

View File

@ -1,3 +1,3 @@
python = python
local_only = false
support_websockets = true
python = python
restrict_to_local_connections = false
support_websockets = false