diff options
author | Melanie Thielker | 2008-10-11 17:51:16 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-11 17:51:16 +0000 |
commit | 143419ebb256a55e2352e3af39952f0e7aae3620 (patch) | |
tree | b6e93356ead03f1b9bb66202d01dfbe2d47a6439 /OpenSim/Region | |
parent | Add logging in case of a SOG without rootpart (diff) | |
download | opensim-SC-143419ebb256a55e2352e3af39952f0e7aae3620.zip opensim-SC-143419ebb256a55e2352e3af39952f0e7aae3620.tar.gz opensim-SC-143419ebb256a55e2352e3af39952f0e7aae3620.tar.bz2 opensim-SC-143419ebb256a55e2352e3af39952f0e7aae3620.tar.xz |
Add a "inimaster" switch to OpenSim.ini. It will load a master ini file
and then the OpenSim.ini only needs to contain instance specific data
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 17 |
2 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 86661b8..09d821f 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -72,6 +72,7 @@ namespace OpenSim | |||
72 | 72 | ||
73 | configSource.AddSwitch("Startup", "background"); | 73 | configSource.AddSwitch("Startup", "background"); |
74 | configSource.AddSwitch("Startup", "inifile"); | 74 | configSource.AddSwitch("Startup", "inifile"); |
75 | configSource.AddSwitch("Startup", "inimaster"); | ||
75 | configSource.AddSwitch("Startup", "gridmode"); | 76 | configSource.AddSwitch("Startup", "gridmode"); |
76 | configSource.AddSwitch("Startup", "physics"); | 77 | configSource.AddSwitch("Startup", "physics"); |
77 | configSource.AddSwitch("Startup", "useexecutepath"); | 78 | configSource.AddSwitch("Startup", "useexecutepath"); |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index b116afa..8bd2537 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -161,20 +161,30 @@ namespace OpenSim | |||
161 | IConfig startupConfig = configSource.Configs["Startup"]; | 161 | IConfig startupConfig = configSource.Configs["Startup"]; |
162 | 162 | ||
163 | string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini"); | 163 | string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini"); |
164 | Application.iniFilePath = Path.Combine(Util.configDir(), iniFileName); | 164 | if (!iniFileName.StartsWith("/") && !iniFileName.StartsWith("\\")) |
165 | Application.iniFilePath = Path.Combine(Util.configDir(), iniFileName); | ||
166 | |||
167 | string masterFileName = startupConfig.GetString("inimaster", ""); | ||
168 | string masterfilePath = masterFileName; | ||
169 | if (!masterFileName.StartsWith("/") && !masterFileName.StartsWith("\\") && masterFileName != "") | ||
170 | masterfilePath = Path.Combine(Util.configDir(), masterfilePath); | ||
165 | 171 | ||
166 | m_config = new OpenSimConfigSource(); | 172 | m_config = new OpenSimConfigSource(); |
167 | m_config.Source = new IniConfigSource(); | 173 | m_config.Source = new IniConfigSource(); |
168 | m_config.Source.Merge(DefaultConfig()); | 174 | m_config.Source.Merge(DefaultConfig()); |
169 | 175 | ||
170 | //check for .INI file (either default or name passed in command line) | 176 | //check for .INI file (either default or name passed in command line) |
177 | if (File.Exists(masterfilePath)) | ||
178 | { | ||
179 | m_config.Source.Merge(new IniConfigSource(masterfilePath)); | ||
180 | } | ||
181 | |||
171 | if (File.Exists(Application.iniFilePath)) | 182 | if (File.Exists(Application.iniFilePath)) |
172 | { | 183 | { |
173 | iniFileExists = true; | 184 | iniFileExists = true; |
174 | 185 | ||
175 | // From reading Nini's code, it seems that later merged keys replace earlier ones. | 186 | // From reading Nini's code, it seems that later merged keys replace earlier ones. |
176 | m_config.Source.Merge(new IniConfigSource(Application.iniFilePath)); | 187 | m_config.Source.Merge(new IniConfigSource(Application.iniFilePath)); |
177 | m_config.Source.Merge(configSource); | ||
178 | } | 188 | } |
179 | else | 189 | else |
180 | { | 190 | { |
@@ -187,10 +197,11 @@ namespace OpenSim | |||
187 | 197 | ||
188 | m_config.Source = new XmlConfigSource(); | 198 | m_config.Source = new XmlConfigSource(); |
189 | m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); | 199 | m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); |
190 | m_config.Source.Merge(configSource); | ||
191 | } | 200 | } |
192 | } | 201 | } |
193 | 202 | ||
203 | m_config.Source.Merge(configSource); | ||
204 | |||
194 | if (!iniFileExists) | 205 | if (!iniFileExists) |
195 | m_config.Save("OpenSim.ini"); | 206 | m_config.Save("OpenSim.ini"); |
196 | 207 | ||