diff options
-rw-r--r-- | OpenSim/Framework/PluginLoader.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 25 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 6 |
3 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 819cb7b..a2bf9f3 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -215,7 +215,7 @@ namespace OpenSim.Framework | |||
215 | AddinManager.AddinLoadError += on_addinloaderror_; | 215 | AddinManager.AddinLoadError += on_addinloaderror_; |
216 | AddinManager.AddinLoaded += on_addinloaded_; | 216 | AddinManager.AddinLoaded += on_addinloaded_; |
217 | 217 | ||
218 | clear_registry_(); | 218 | clear_registry_(dir); |
219 | 219 | ||
220 | suppress_console_output_(true); | 220 | suppress_console_output_(true); |
221 | AddinManager.Initialize(dir); | 221 | AddinManager.Initialize(dir); |
@@ -239,18 +239,19 @@ namespace OpenSim.Framework | |||
239 | + args.Exception.StackTrace); | 239 | + args.Exception.StackTrace); |
240 | } | 240 | } |
241 | 241 | ||
242 | private void clear_registry_() | 242 | private void clear_registry_(string dir) |
243 | { | 243 | { |
244 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) | 244 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) |
245 | // occasionally seems to corrupt its addin cache | 245 | // occasionally seems to corrupt its addin cache |
246 | // Hence, as a temporary solution we'll remove it before each startup | 246 | // Hence, as a temporary solution we'll remove it before each startup |
247 | |||
247 | try | 248 | try |
248 | { | 249 | { |
249 | if (Directory.Exists("addin-db-000")) | 250 | if (Directory.Exists(dir + "/addin-db-000")) |
250 | Directory.Delete("addin-db-000", true); | 251 | Directory.Delete(dir + "/addin-db-000", true); |
251 | 252 | ||
252 | if (Directory.Exists("addin-db-001")) | 253 | if (Directory.Exists(dir + "/addin-db-001")) |
253 | Directory.Delete("addin-db-001", true); | 254 | Directory.Delete(dir + "/addin-db-001", true); |
254 | } | 255 | } |
255 | catch (IOException) | 256 | catch (IOException) |
256 | { | 257 | { |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0dc9306..9d36986 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -158,10 +158,27 @@ namespace OpenSim | |||
158 | 158 | ||
159 | protected virtual void LoadPlugins() | 159 | protected virtual void LoadPlugins() |
160 | { | 160 | { |
161 | using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this))) | 161 | IConfig startupConfig = Config.Configs["Startup"]; |
162 | string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty; | ||
163 | |||
164 | // The location can also be specified in the environment. If there | ||
165 | // is no location in the configuration, we must call the constructor | ||
166 | // without a location parameter to allow that to happen. | ||
167 | if (registryLocation == String.Empty) | ||
162 | { | 168 | { |
163 | loader.Load("/OpenSim/Startup"); | 169 | using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this))) |
164 | m_plugins = loader.Plugins; | 170 | { |
171 | loader.Load("/OpenSim/Startup"); | ||
172 | m_plugins = loader.Plugins; | ||
173 | } | ||
174 | } | ||
175 | else | ||
176 | { | ||
177 | using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this), registryLocation)) | ||
178 | { | ||
179 | loader.Load("/OpenSim/Startup"); | ||
180 | m_plugins = loader.Plugins; | ||
181 | } | ||
165 | } | 182 | } |
166 | } | 183 | } |
167 | 184 | ||
@@ -1049,4 +1066,4 @@ namespace OpenSim | |||
1049 | { | 1066 | { |
1050 | public IConfigSource Source; | 1067 | public IConfigSource Source; |
1051 | } | 1068 | } |
1052 | } \ No newline at end of file | 1069 | } |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index d8474d3..4f2563c 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -57,6 +57,12 @@ | |||
57 | ; when running with the SmartThreadPool option above | 57 | ; when running with the SmartThreadPool option above |
58 | MaxPoolThreads = 15 | 58 | MaxPoolThreads = 15 |
59 | 59 | ||
60 | ; Plugin Registry Location | ||
61 | ; Set path to directory for plugin registry. Information about the | ||
62 | ; registered repositories and installed plugins will be stored here. | ||
63 | ; The OpenSim.exe process must have R/W access to the location. | ||
64 | ; RegistryLocation = "." | ||
65 | |||
60 | ; ## | 66 | ; ## |
61 | ; ## CLIENTS | 67 | ; ## CLIENTS |
62 | ; ## | 68 | ; ## |