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') 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