aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-09 18:33:42 +0000
committerJustin Clarke Casey2008-10-09 18:33:42 +0000
commitc26f177cd4320f306f1b07d18032f0d42720ba09 (patch)
treee8ecb3435b02c1fa2d6ccd6c0cdc5d56967807f4
parentProvide a sane value for DefaultScriptEngine (ScriptEngine.DotNetEngine) (diff)
downloadopensim-SC_OLD-c26f177cd4320f306f1b07d18032f0d42720ba09.zip
opensim-SC_OLD-c26f177cd4320f306f1b07d18032f0d42720ba09.tar.gz
opensim-SC_OLD-c26f177cd4320f306f1b07d18032f0d42720ba09.tar.bz2
opensim-SC_OLD-c26f177cd4320f306f1b07d18032f0d42720ba09.tar.xz
* Fix http://opensimulator.org/mantis/view.php?id=2368
* This returns to writing the OpenSim.ini using default values if it (or OpenSim.xml) isn't found
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 132e86d..b116afa 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -156,6 +156,8 @@ namespace OpenSim
156 /// <param name="configSource"></param> 156 /// <param name="configSource"></param>
157 public OpenSimBase(IConfigSource configSource) : base() 157 public OpenSimBase(IConfigSource configSource) : base()
158 { 158 {
159 bool iniFileExists = false;
160
159 IConfig startupConfig = configSource.Configs["Startup"]; 161 IConfig startupConfig = configSource.Configs["Startup"];
160 162
161 string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini"); 163 string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini");
@@ -168,6 +170,8 @@ namespace OpenSim
168 //check for .INI file (either default or name passed in command line) 170 //check for .INI file (either default or name passed in command line)
169 if (File.Exists(Application.iniFilePath)) 171 if (File.Exists(Application.iniFilePath))
170 { 172 {
173 iniFileExists = true;
174
171 // From reading Nini's code, it seems that later merged keys replace earlier ones. 175 // From reading Nini's code, it seems that later merged keys replace earlier ones.
172 m_config.Source.Merge(new IniConfigSource(Application.iniFilePath)); 176 m_config.Source.Merge(new IniConfigSource(Application.iniFilePath));
173 m_config.Source.Merge(configSource); 177 m_config.Source.Merge(configSource);
@@ -179,11 +183,16 @@ namespace OpenSim
179 183
180 if (File.Exists(Application.iniFilePath)) 184 if (File.Exists(Application.iniFilePath))
181 { 185 {
186 iniFileExists = true;
187
182 m_config.Source = new XmlConfigSource(); 188 m_config.Source = new XmlConfigSource();
183 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); 189 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath));
184 m_config.Source.Merge(configSource); 190 m_config.Source.Merge(configSource);
185 } 191 }
186 } 192 }
193
194 if (!iniFileExists)
195 m_config.Save("OpenSim.ini");
187 196
188 ReadConfigSettings(); 197 ReadConfigSettings();
189 } 198 }