diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index ac65e82..6a103bd 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -45,10 +45,11 @@ namespace OpenSim | |||
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | public ConfigurationLoader() | 47 | public ConfigurationLoader() |
48 | { | 48 | { |
49 | } | 49 | } |
50 | 50 | ||
51 | public OpenSimConfigSource LoadConfigSettings(IConfigSource configSource, out ConfigSettings configSettings, out NetworkServersInfo networkInfo) | 51 | public OpenSimConfigSource LoadConfigSettings(IConfigSource configSource, out ConfigSettings configSettings, |
52 | out NetworkServersInfo networkInfo) | ||
52 | { | 53 | { |
53 | m_configSettings = configSettings = new ConfigSettings(); | 54 | m_configSettings = configSettings = new ConfigSettings(); |
54 | m_networkServersInfo = networkInfo = new NetworkServersInfo(); | 55 | m_networkServersInfo = networkInfo = new NetworkServersInfo(); |
@@ -70,16 +71,17 @@ namespace OpenSim | |||
70 | m_config.Source.Merge(DefaultConfig()); | 71 | m_config.Source.Merge(DefaultConfig()); |
71 | 72 | ||
72 | m_log.Info("[CONFIG] Reading configuration settings"); | 73 | m_log.Info("[CONFIG] Reading configuration settings"); |
73 | 74 | ||
74 | Uri configUri; | 75 | Uri configUri; |
75 | String xmlPath = Path.Combine(Util.configDir(), "OpenSim.xml"); | 76 | String xmlPath = Path.Combine(Util.configDir(), "OpenSim.xml"); |
76 | 77 | ||
77 | //check for master .INI file (name passed in command line, no default), or XML over http | 78 | //check for master .INI file (name passed in command line, no default), or XML over http |
78 | if (masterFileName.Length > 0) // If a master file name is given ... | 79 | if (masterFileName.Length > 0) // If a master file name is given ... |
79 | { | 80 | { |
80 | m_log.InfoFormat("[CONFIG] Reading config master file {0}", masterfilePath); | 81 | m_log.InfoFormat("[CONFIG] Reading config master file {0}", masterfilePath); |
81 | 82 | ||
82 | bool isMasterUri = Uri.TryCreate(masterFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; | 83 | bool isMasterUri = Uri.TryCreate(masterFileName, UriKind.Absolute, out configUri) && |
84 | configUri.Scheme == Uri.UriSchemeHttp; | ||
83 | 85 | ||
84 | if (!ReadConfig(masterFileName, masterfilePath, m_config, isMasterUri)) | 86 | if (!ReadConfig(masterFileName, masterfilePath, m_config, isMasterUri)) |
85 | { | 87 | { |
@@ -100,10 +102,11 @@ namespace OpenSim | |||
100 | } | 102 | } |
101 | } | 103 | } |
102 | } | 104 | } |
103 | 105 | ||
104 | // Check for .INI file (either default or name passed on command | 106 | // Check for .INI file (either default or name passed on command |
105 | // line) or XML config source over http | 107 | // line) or XML config source over http |
106 | bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; | 108 | bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) && |
109 | configUri.Scheme == Uri.UriSchemeHttp; | ||
107 | iniFileExists = ReadConfig(iniFileName, Application.iniFilePath, m_config, isIniUri); | 110 | iniFileExists = ReadConfig(iniFileName, Application.iniFilePath, m_config, isIniUri); |
108 | 111 | ||
109 | if (!iniFileExists) | 112 | if (!iniFileExists) |
@@ -119,7 +122,7 @@ namespace OpenSim | |||
119 | m_config.Source = new XmlConfigSource(); | 122 | m_config.Source = new XmlConfigSource(); |
120 | m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); | 123 | m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); |
121 | } | 124 | } |
122 | } | 125 | } |
123 | 126 | ||
124 | m_config.Source.Merge(configSource); | 127 | m_config.Source.Merge(configSource); |
125 | 128 | ||
@@ -152,7 +155,7 @@ namespace OpenSim | |||
152 | private bool ReadConfig(string iniName, string iniPath, OpenSimConfigSource m_config, bool isUri) | 155 | private bool ReadConfig(string iniName, string iniPath, OpenSimConfigSource m_config, bool isUri) |
153 | { | 156 | { |
154 | bool success = false; | 157 | bool success = false; |
155 | 158 | ||
156 | if (!isUri && File.Exists(iniPath)) | 159 | if (!isUri && File.Exists(iniPath)) |
157 | { | 160 | { |
158 | m_log.InfoFormat("[CONFIG] Reading configuration file {0}", Path.GetFullPath(iniPath)); | 161 | m_log.InfoFormat("[CONFIG] Reading configuration file {0}", Path.GetFullPath(iniPath)); |
@@ -235,7 +238,7 @@ namespace OpenSim | |||
235 | config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); | 238 | config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); |
236 | config.Set("user_source", ""); | 239 | config.Set("user_source", ""); |
237 | config.Set("asset_plugin", "OpenSim.Data.SQLite.dll"); | 240 | config.Set("asset_plugin", "OpenSim.Data.SQLite.dll"); |
238 | config.Set("asset_source", ""); | 241 | config.Set("asset_source", ""); |
239 | config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); | 242 | config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); |
240 | config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar)); | 243 | config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar)); |
241 | config.Set("dump_assets_to_file", false); | 244 | config.Set("dump_assets_to_file", false); |
@@ -307,11 +310,11 @@ namespace OpenSim | |||
307 | 310 | ||
308 | m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile"); | 311 | m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile"); |
309 | m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile"); | 312 | m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile"); |
310 | 313 | ||
311 | m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); | 314 | m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); |
312 | } | 315 | } |
313 | 316 | ||
314 | m_networkServersInfo.loadFromConfiguration(m_config.Source); | 317 | m_networkServersInfo.loadFromConfiguration(m_config.Source); |
315 | } | 318 | } |
316 | } | 319 | } |
317 | } | 320 | } \ No newline at end of file |