diff options
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 24 |
1 files changed, 19 insertions, 5 deletions
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 | |||
159 | protected virtual void LoadPlugins() | 159 | protected virtual void LoadPlugins() |
160 | { | 160 | { |
161 | IConfig startupConfig = Config.Configs["Startup"]; | 161 | IConfig startupConfig = Config.Configs["Startup"]; |
162 | string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation",".") : "."; | 162 | string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty; |
163 | 163 | ||
164 | using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this), registryLocation)) | 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) | ||
165 | { | 168 | { |
166 | loader.Load("/OpenSim/Startup"); | 169 | using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this))) |
167 | 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 | } | ||
168 | } | 182 | } |
169 | } | 183 | } |
170 | 184 | ||
@@ -1052,4 +1066,4 @@ namespace OpenSim | |||
1052 | { | 1066 | { |
1053 | public IConfigSource Source; | 1067 | public IConfigSource Source; |
1054 | } | 1068 | } |
1055 | } \ No newline at end of file | 1069 | } |