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/Region/Application/OpenSimBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application/OpenSimBase.cs') 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; -- cgit v1.1 From a4d322dcd1d7f7796180d63b9d9f7405332577c7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 22 Mar 2014 01:47:48 +0000 Subject: Allow the setting from the environment to take effect if no explicit setting is given. This is done by calling the constructor only with a directory if one is actually given. --- OpenSim/Region/Application/OpenSimBase.cs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Application/OpenSimBase.cs') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 8a27967..9d36986 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -159,12 +159,26 @@ namespace OpenSim protected virtual void LoadPlugins() { IConfig startupConfig = Config.Configs["Startup"]; - string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation",".") : "."; + string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty; - using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + // The location can also be specified in the environment. If there + // is no location in the configuration, we must call the constructor + // without a location parameter to allow that to happen. + if (registryLocation == String.Empty) { - loader.Load("/OpenSim/Startup"); - m_plugins = loader.Plugins; + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } + } + else + { + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } } } @@ -1052,4 +1066,4 @@ namespace OpenSim { public IConfigSource Source; } -} \ No newline at end of file +} -- cgit v1.1