diff options
author | MW | 2009-02-27 14:17:57 +0000 |
---|---|---|
committer | MW | 2009-02-27 14:17:57 +0000 |
commit | b83d5c7cdb3edba593b660ed8499e1a4bc9de43b (patch) | |
tree | c17351673613c581cd744518355ff39a4120c5e4 /OpenSim/Region | |
parent | svn attribute fixes so that we can play nice between windows and linux (diff) | |
download | opensim-SC_OLD-b83d5c7cdb3edba593b660ed8499e1a4bc9de43b.zip opensim-SC_OLD-b83d5c7cdb3edba593b660ed8499e1a4bc9de43b.tar.gz opensim-SC_OLD-b83d5c7cdb3edba593b660ed8499e1a4bc9de43b.tar.bz2 opensim-SC_OLD-b83d5c7cdb3edba593b660ed8499e1a4bc9de43b.tar.xz |
Added support for reading ini files from a (optional) config folder. This allows the spliting up of opensim.ini into multiple ini files.
The ini files in this folder are loaded after the masterini file (if that is set) and before opensim.ini.
The default folder it looks for and searches is "bin\config", but that can be set by using the command arg "-inidirectory=<path>" (path is local to bin\) when starting up opensim.exe.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 017160a..0c01b02 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -78,6 +78,7 @@ namespace OpenSim | |||
78 | configSource.AddSwitch("Startup", "background"); | 78 | configSource.AddSwitch("Startup", "background"); |
79 | configSource.AddSwitch("Startup", "inifile"); | 79 | configSource.AddSwitch("Startup", "inifile"); |
80 | configSource.AddSwitch("Startup", "inimaster"); | 80 | configSource.AddSwitch("Startup", "inimaster"); |
81 | configSource.AddSwitch("Startup", "inidirectory"); | ||
81 | configSource.AddSwitch("Startup", "gridmode"); | 82 | configSource.AddSwitch("Startup", "gridmode"); |
82 | configSource.AddSwitch("Startup", "physics"); | 83 | configSource.AddSwitch("Startup", "physics"); |
83 | configSource.AddSwitch("Startup", "useexecutepath"); | 84 | configSource.AddSwitch("Startup", "useexecutepath"); |
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index f3f9f29..64797da 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -62,6 +62,9 @@ namespace OpenSim | |||
62 | string masterFileName = startupConfig.GetString("inimaster", ""); | 62 | string masterFileName = startupConfig.GetString("inimaster", ""); |
63 | string masterfilePath = Path.Combine(Util.configDir(), masterFileName); | 63 | string masterfilePath = Path.Combine(Util.configDir(), masterFileName); |
64 | 64 | ||
65 | string iniDirName = startupConfig.GetString("inidirectory", "config"); | ||
66 | string iniDirPath = Path.Combine(Util.configDir(), iniDirName); | ||
67 | |||
65 | m_config = new OpenSimConfigSource(); | 68 | m_config = new OpenSimConfigSource(); |
66 | m_config.Source = new IniConfigSource(); | 69 | m_config.Source = new IniConfigSource(); |
67 | m_config.Source.Merge(DefaultConfig()); | 70 | m_config.Source.Merge(DefaultConfig()); |
@@ -84,6 +87,17 @@ namespace OpenSim | |||
84 | } | 87 | } |
85 | } | 88 | } |
86 | 89 | ||
90 | if (Directory.Exists(iniDirName)) | ||
91 | { | ||
92 | m_log.InfoFormat("Searching folder: {0} , for config ini files", iniDirName); | ||
93 | string[] fileEntries = Directory.GetFiles(iniDirName); | ||
94 | foreach (string filePath in fileEntries) | ||
95 | { | ||
96 | // m_log.InfoFormat("reading ini file < {0} > from config dir", filePath); | ||
97 | ReadConfig(Path.GetFileName(filePath), filePath, m_config, false); | ||
98 | } | ||
99 | } | ||
100 | |||
87 | // Check for .INI file (either default or name passed on command | 101 | // Check for .INI file (either default or name passed on command |
88 | // line) or XML config source over http | 102 | // line) or XML config source over http |
89 | bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; | 103 | bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; |
@@ -251,7 +265,6 @@ namespace OpenSim | |||
251 | protected virtual void ReadConfigSettings() | 265 | protected virtual void ReadConfigSettings() |
252 | { | 266 | { |
253 | IConfig startupConfig = m_config.Source.Configs["Startup"]; | 267 | IConfig startupConfig = m_config.Source.Configs["Startup"]; |
254 | |||
255 | if (startupConfig != null) | 268 | if (startupConfig != null) |
256 | { | 269 | { |
257 | m_configSettings.Standalone = !startupConfig.GetBoolean("gridmode", false); | 270 | m_configSettings.Standalone = !startupConfig.GetBoolean("gridmode", false); |