From 3d0778bcd6ca6711850257a7d666fc30919e7e66 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Fri, 21 Mar 2014 20:43:26 -0400 Subject: Allow Mono Plugin Registry setting for Regions Signed-off-by: Melanie --- OpenSim/Framework/PluginLoader.cs | 13 +++++++------ OpenSim/Region/Application/OpenSimBase.cs | 5 ++++- bin/OpenSimDefaults.ini | 6 ++++++ 3 files changed, 17 insertions(+), 7 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 AddinManager.AddinLoadError += on_addinloaderror_; AddinManager.AddinLoaded += on_addinloaded_; - clear_registry_(); + clear_registry_(dir); suppress_console_output_(true); AddinManager.Initialize(dir); @@ -239,18 +239,19 @@ namespace OpenSim.Framework + args.Exception.StackTrace); } - private void clear_registry_() + private void clear_registry_(string dir) { // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) // occasionally seems to corrupt its addin cache // Hence, as a temporary solution we'll remove it before each startup + try { - if (Directory.Exists("addin-db-000")) - Directory.Delete("addin-db-000", true); + if (Directory.Exists(dir + "/addin-db-000")) + Directory.Delete(dir + "/addin-db-000", true); - if (Directory.Exists("addin-db-001")) - Directory.Delete("addin-db-001", true); + if (Directory.Exists(dir + "/addin-db-001")) + Directory.Delete(dir + "/addin-db-001", true); } catch (IOException) { diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0dc9306..8a27967 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -158,7 +158,10 @@ namespace OpenSim protected virtual void LoadPlugins() { - using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + IConfig startupConfig = Config.Configs["Startup"]; + string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation",".") : "."; + + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) { loader.Load("/OpenSim/Startup"); m_plugins = loader.Plugins; 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 @@ ; when running with the SmartThreadPool option above MaxPoolThreads = 15 + ; Plugin Registry Location + ; Set path to directory for plugin registry. Information about the + ; registered repositories and installed plugins will be stored here. + ; The OpenSim.exe process must have R/W access to the location. + ; RegistryLocation = "." + ; ## ; ## CLIENTS ; ## -- cgit v1.1