diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 3a65242..c3e7b86 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -37,12 +37,32 @@ using OpenSim.Framework; | |||
37 | 37 | ||
38 | namespace OpenSim | 38 | namespace OpenSim |
39 | { | 39 | { |
40 | /// <summary> | ||
41 | /// Loads the Configuration files into nIni | ||
42 | /// </summary> | ||
40 | public class ConfigurationLoader | 43 | public class ConfigurationLoader |
41 | { | 44 | { |
45 | /// <summary> | ||
46 | /// Various Config settings the region needs to start | ||
47 | /// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor, | ||
48 | /// StorageDLL, Storage Connection String, Estate connection String, Client Stack | ||
49 | /// Standalone settings. | ||
50 | /// </summary> | ||
42 | protected ConfigSettings m_configSettings; | 51 | protected ConfigSettings m_configSettings; |
52 | |||
53 | /// <summary> | ||
54 | /// A source of Configuration data | ||
55 | /// </summary> | ||
43 | protected OpenSimConfigSource m_config; | 56 | protected OpenSimConfigSource m_config; |
57 | |||
58 | /// <summary> | ||
59 | /// Grid Service Information. This refers to classes and addresses of the grid service | ||
60 | /// </summary> | ||
44 | protected NetworkServersInfo m_networkServersInfo; | 61 | protected NetworkServersInfo m_networkServersInfo; |
45 | 62 | ||
63 | /// <summary> | ||
64 | /// Console logger | ||
65 | /// </summary> | ||
46 | private static readonly ILog m_log = | 66 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 67 | LogManager.GetLogger( |
48 | MethodBase.GetCurrentMethod().DeclaringType); | 68 | MethodBase.GetCurrentMethod().DeclaringType); |
@@ -51,6 +71,13 @@ namespace OpenSim | |||
51 | { | 71 | { |
52 | } | 72 | } |
53 | 73 | ||
74 | /// <summary> | ||
75 | /// Loads the region configuration | ||
76 | /// </summary> | ||
77 | /// <param name="argvSource">Parameters passed into the process when started</param> | ||
78 | /// <param name="configSettings"></param> | ||
79 | /// <param name="networkInfo"></param> | ||
80 | /// <returns>A configuration that gets passed to modules</returns> | ||
54 | public OpenSimConfigSource LoadConfigSettings( | 81 | public OpenSimConfigSource LoadConfigSettings( |
55 | IConfigSource argvSource, out ConfigSettings configSettings, | 82 | IConfigSource argvSource, out ConfigSettings configSettings, |
56 | out NetworkServersInfo networkInfo) | 83 | out NetworkServersInfo networkInfo) |
@@ -169,15 +196,22 @@ namespace OpenSim | |||
169 | return m_config; | 196 | return m_config; |
170 | } | 197 | } |
171 | 198 | ||
199 | /// <summary> | ||
200 | /// Adds the included files as ini configuration files | ||
201 | /// </summary> | ||
202 | /// <param name="sources">List of URL strings or filename strings</param> | ||
172 | private void AddIncludes(List<string> sources) | 203 | private void AddIncludes(List<string> sources) |
173 | { | 204 | { |
205 | //loop over config sources | ||
174 | foreach (IConfig config in m_config.Source.Configs) | 206 | foreach (IConfig config in m_config.Source.Configs) |
175 | { | 207 | { |
208 | // Look for Include-* in the key name | ||
176 | string[] keys = config.GetKeys(); | 209 | string[] keys = config.GetKeys(); |
177 | foreach (string k in keys) | 210 | foreach (string k in keys) |
178 | { | 211 | { |
179 | if (k.StartsWith("Include-")) | 212 | if (k.StartsWith("Include-")) |
180 | { | 213 | { |
214 | // read the config file to be included. | ||
181 | string file = config.GetString(k); | 215 | string file = config.GetString(k); |
182 | if (IsUri(file)) | 216 | if (IsUri(file)) |
183 | { | 217 | { |
@@ -199,7 +233,11 @@ namespace OpenSim | |||
199 | } | 233 | } |
200 | } | 234 | } |
201 | } | 235 | } |
202 | 236 | /// <summary> | |
237 | /// Check if we can convert the string to a URI | ||
238 | /// </summary> | ||
239 | /// <param name="file">String uri to the remote resource</param> | ||
240 | /// <returns>true if we can convert the string to a Uri object</returns> | ||
203 | bool IsUri(string file) | 241 | bool IsUri(string file) |
204 | { | 242 | { |
205 | Uri configUri; | 243 | Uri configUri; |
@@ -253,7 +291,7 @@ namespace OpenSim | |||
253 | /// <summary> | 291 | /// <summary> |
254 | /// Setup a default config values in case they aren't present in the ini file | 292 | /// Setup a default config values in case they aren't present in the ini file |
255 | /// </summary> | 293 | /// </summary> |
256 | /// <returns></returns> | 294 | /// <returns>A Configuration source containing the default configuration</returns> |
257 | private static IConfigSource DefaultConfig() | 295 | private static IConfigSource DefaultConfig() |
258 | { | 296 | { |
259 | IConfigSource defaultConfig = new IniConfigSource(); | 297 | IConfigSource defaultConfig = new IniConfigSource(); |
@@ -322,6 +360,9 @@ namespace OpenSim | |||
322 | return defaultConfig; | 360 | return defaultConfig; |
323 | } | 361 | } |
324 | 362 | ||
363 | /// <summary> | ||
364 | /// Read initial region settings from the ConfigSource | ||
365 | /// </summary> | ||
325 | protected virtual void ReadConfigSettings() | 366 | protected virtual void ReadConfigSettings() |
326 | { | 367 | { |
327 | IConfig startupConfig = m_config.Source.Configs["Startup"]; | 368 | IConfig startupConfig = m_config.Source.Configs["Startup"]; |