diff options
author | Sean Dague | 2007-10-19 20:27:34 +0000 |
---|---|---|
committer | Sean Dague | 2007-10-19 20:27:34 +0000 |
commit | 139994757c7dab04dd03801266525e8c53395a5e (patch) | |
tree | 003ec2557de6dd80dbe1e7bc78efe8958d02d5ae /OpenSim/Region/Application | |
parent | * Test thy commits! (oops, sorry!) (diff) | |
download | opensim-SC-139994757c7dab04dd03801266525e8c53395a5e.zip opensim-SC-139994757c7dab04dd03801266525e8c53395a5e.tar.gz opensim-SC-139994757c7dab04dd03801266525e8c53395a5e.tar.bz2 opensim-SC-139994757c7dab04dd03801266525e8c53395a5e.tar.xz |
changes to pass nini config object to the modules that get
loaded so that they may read out any bits they are interested in
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 5fb514f..c367537 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -63,6 +63,7 @@ namespace OpenSim | |||
63 | 63 | ||
64 | protected ModuleLoader m_moduleLoader; | 64 | protected ModuleLoader m_moduleLoader; |
65 | protected LocalLoginService m_loginService; | 65 | protected LocalLoginService m_loginService; |
66 | private IConfigSource m_config; | ||
66 | 67 | ||
67 | protected string m_storageDLL = "OpenSim.DataStore.NullStorage.dll"; | 68 | protected string m_storageDLL = "OpenSim.DataStore.NullStorage.dll"; |
68 | 69 | ||
@@ -89,9 +90,8 @@ namespace OpenSim | |||
89 | public OpenSimMain(IConfigSource configSource) | 90 | public OpenSimMain(IConfigSource configSource) |
90 | : base() | 91 | : base() |
91 | { | 92 | { |
92 | IConfigSource startupSource = configSource; | 93 | string iniFile = configSource.Configs["Startup"].GetString("inifile", "OpenSim.ini"); |
93 | string iniFile = startupSource.Configs["Startup"].GetString("inifile", "OpenSim.ini"); | 94 | string useExecutePathString = configSource.Configs["Startup"].GetString("useexecutepath", "false").ToLower(); |
94 | string useExecutePathString = startupSource.Configs["Startup"].GetString("useexecutepath", "false").ToLower(); | ||
95 | bool useExecutePath = false; | 95 | bool useExecutePath = false; |
96 | if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes") | 96 | if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes") |
97 | { | 97 | { |
@@ -104,46 +104,46 @@ namespace OpenSim | |||
104 | string iniFilePath = Path.Combine(Util.configDir(), iniFile); | 104 | string iniFilePath = Path.Combine(Util.configDir(), iniFile); |
105 | if (File.Exists(iniFilePath)) | 105 | if (File.Exists(iniFilePath)) |
106 | { | 106 | { |
107 | startupSource = new IniConfigSource(iniFilePath); | 107 | m_config = new IniConfigSource(iniFilePath); |
108 | 108 | ||
109 | //enable following line, if we want the original config source(normally commandline args) merged with ini file settings. | 109 | //enable following line, if we want the original config source(normally commandline args) merged with ini file settings. |
110 | //in this case we have it so that if both sources have the same named setting, the command line value will overwrite the ini file value. | 110 | //in this case we have it so that if both sources have the same named setting, the command line value will overwrite the ini file value. |
111 | //(as if someone has bothered to enter a command line arg, we should take notice of it) | 111 | //(as if someone has bothered to enter a command line arg, we should take notice of it) |
112 | startupSource.Merge(configSource); | 112 | m_config.Merge(configSource); |
113 | } | 113 | } |
114 | 114 | ||
115 | ReadConfigSettings(startupSource); | 115 | ReadConfigSettings(); |
116 | 116 | ||
117 | } | 117 | } |
118 | 118 | ||
119 | protected void ReadConfigSettings(IConfigSource configSource) | 119 | protected void ReadConfigSettings() |
120 | { | 120 | { |
121 | m_networkServersInfo = new NetworkServersInfo(); | 121 | m_networkServersInfo = new NetworkServersInfo(); |
122 | m_sandbox = !configSource.Configs["Startup"].GetBoolean("gridmode", false); | 122 | m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false); |
123 | m_physicsEngine = configSource.Configs["Startup"].GetString("physics", "basicphysics"); | 123 | m_physicsEngine = m_config.Configs["Startup"].GetString("physics", "basicphysics"); |
124 | m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false); | 124 | m_silent = m_config.Configs["Startup"].GetBoolean("noverbose", false); |
125 | m_permissions = configSource.Configs["Startup"].GetBoolean("serverside_object_permissions", false); | 125 | m_permissions = m_config.Configs["Startup"].GetBoolean("serverside_object_permissions", false); |
126 | 126 | ||
127 | m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); | 127 | m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); |
128 | 128 | ||
129 | m_startupCommandsFile = configSource.Configs["Startup"].GetString("startup_console_commands_file", ""); | 129 | m_startupCommandsFile = m_config.Configs["Startup"].GetString("startup_console_commands_file", ""); |
130 | m_shutdownCommandsFile = configSource.Configs["Startup"].GetString("shutdown_console_commands_file", ""); | 130 | m_shutdownCommandsFile = m_config.Configs["Startup"].GetString("shutdown_console_commands_file", ""); |
131 | 131 | ||
132 | m_scriptEngine = configSource.Configs["Startup"].GetString("script_engine", "DotNetEngine"); | 132 | m_scriptEngine = m_config.Configs["Startup"].GetString("script_engine", "DotNetEngine"); |
133 | 133 | ||
134 | m_assetStorage = configSource.Configs["Startup"].GetString("asset_database", "db4o"); | 134 | m_assetStorage = m_config.Configs["Startup"].GetString("asset_database", "db4o"); |
135 | 135 | ||
136 | configSource.Configs["Startup"].GetBoolean("default_modules", true); | 136 | m_config.Configs["Startup"].GetBoolean("default_modules", true); |
137 | configSource.Configs["Startup"].GetBoolean("default_shared_modules", true); | 137 | m_config.Configs["Startup"].GetBoolean("default_shared_modules", true); |
138 | configSource.Configs["Startup"].GetString("except_modules", ""); | 138 | m_config.Configs["Startup"].GetString("except_modules", ""); |
139 | configSource.Configs["Startup"].GetString("except_shared_modules", ""); | 139 | m_config.Configs["Startup"].GetString("except_shared_modules", ""); |
140 | 140 | ||
141 | standaloneAuthenticate = configSource.Configs["StandAlone"].GetBoolean("accounts_authenticate", false); | 141 | standaloneAuthenticate = m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate", false); |
142 | standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); | 142 | standaloneWelcomeMessage = m_config.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); |
143 | standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); | 143 | standaloneInventoryPlugin = m_config.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); |
144 | standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); | 144 | standaloneUserPlugin = m_config.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); |
145 | standaloneAssetPlugin = configSource.Configs["StandAlone"].GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll"); | 145 | standaloneAssetPlugin = m_config.Configs["StandAlone"].GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll"); |
146 | m_networkServersInfo.loadFromConfiguration(configSource); | 146 | m_networkServersInfo.loadFromConfiguration(m_config); |
147 | } | 147 | } |
148 | 148 | ||
149 | 149 | ||
@@ -207,7 +207,7 @@ namespace OpenSim | |||
207 | configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 207 | configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
208 | } | 208 | } |
209 | 209 | ||
210 | m_moduleLoader = new ModuleLoader( m_log ); | 210 | m_moduleLoader = new ModuleLoader( m_log, m_config ); |
211 | MainLog.Instance.Verbose("Loading Shared Modules"); | 211 | MainLog.Instance.Verbose("Loading Shared Modules"); |
212 | m_moduleLoader.LoadDefaultSharedModules(); | 212 | m_moduleLoader.LoadDefaultSharedModules(); |
213 | 213 | ||