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.
0.8.0.3
Melanie 2014-03-22 01:47:48 +00:00
parent 3d0778bcd6
commit a4d322dcd1
1 changed files with 19 additions and 5 deletions

View File

@ -159,14 +159,28 @@ 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;
// 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)
{
using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this)))
{
loader.Load("/OpenSim/Startup");
m_plugins = loader.Plugins;
}
}
else
{
using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this), registryLocation))
{
loader.Load("/OpenSim/Startup");
m_plugins = loader.Plugins;
}
}
}
protected override List<string> GetHelpTopics()
{