diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index feb3cf8..3dc9907 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -71,6 +71,20 @@ namespace OpenSim | |||
71 | // OpenSim.ini Section name for ESTATES Settings | 71 | // OpenSim.ini Section name for ESTATES Settings |
72 | public const string ESTATE_SECTION_NAME = "Estates"; | 72 | public const string ESTATE_SECTION_NAME = "Estates"; |
73 | 73 | ||
74 | /// <summary> | ||
75 | /// Allow all plugin loading to be disabled for tests/debug. | ||
76 | /// </summary> | ||
77 | /// <remarks> | ||
78 | /// true by default | ||
79 | /// </remarks> | ||
80 | public bool EnableInitialPluginLoad { get; set; } | ||
81 | |||
82 | /// <summary> | ||
83 | /// Control whether we attempt to load an estate data service. | ||
84 | /// </summary> | ||
85 | /// <remarks>For tests/debugging</remarks> | ||
86 | public bool LoadEstateDataService { get; set; } | ||
87 | |||
74 | protected string proxyUrl; | 88 | protected string proxyUrl; |
75 | protected int proxyOffset = 0; | 89 | protected int proxyOffset = 0; |
76 | 90 | ||
@@ -96,7 +110,7 @@ namespace OpenSim | |||
96 | 110 | ||
97 | public ConsoleCommand CreateAccount = null; | 111 | public ConsoleCommand CreateAccount = null; |
98 | 112 | ||
99 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 113 | public List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
100 | 114 | ||
101 | /// <value> | 115 | /// <value> |
102 | /// The config information passed into the OpenSimulator region server. | 116 | /// The config information passed into the OpenSimulator region server. |
@@ -135,6 +149,8 @@ namespace OpenSim | |||
135 | /// <param name="configSource"></param> | 149 | /// <param name="configSource"></param> |
136 | public OpenSimBase(IConfigSource configSource) : base() | 150 | public OpenSimBase(IConfigSource configSource) : base() |
137 | { | 151 | { |
152 | EnableInitialPluginLoad = true; | ||
153 | LoadEstateDataService = true; | ||
138 | LoadConfigSettings(configSource); | 154 | LoadConfigSettings(configSource); |
139 | } | 155 | } |
140 | 156 | ||
@@ -240,20 +256,25 @@ namespace OpenSim | |||
240 | if (String.IsNullOrEmpty(module)) | 256 | if (String.IsNullOrEmpty(module)) |
241 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); | 257 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); |
242 | 258 | ||
243 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); | 259 | if (LoadEstateDataService) |
244 | if (m_estateDataService == null) | 260 | { |
245 | throw new Exception( | 261 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); |
246 | string.Format( | 262 | if (m_estateDataService == null) |
247 | "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", | 263 | throw new Exception( |
248 | module)); | 264 | string.Format( |
265 | "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", | ||
266 | module)); | ||
267 | } | ||
249 | 268 | ||
250 | base.StartupSpecific(); | 269 | base.StartupSpecific(); |
251 | 270 | ||
252 | LoadPlugins(); | 271 | if (EnableInitialPluginLoad) |
272 | LoadPlugins(); | ||
273 | |||
274 | // We still want to post initalize any plugins even if loading has been disabled since a test may have | ||
275 | // inserted them manually. | ||
253 | foreach (IApplicationPlugin plugin in m_plugins) | 276 | foreach (IApplicationPlugin plugin in m_plugins) |
254 | { | ||
255 | plugin.PostInitialise(); | 277 | plugin.PostInitialise(); |
256 | } | ||
257 | 278 | ||
258 | if (m_console != null) | 279 | if (m_console != null) |
259 | AddPluginCommands(m_console); | 280 | AddPluginCommands(m_console); |
@@ -878,6 +899,9 @@ namespace OpenSim | |||
878 | try | 899 | try |
879 | { | 900 | { |
880 | SceneManager.Close(); | 901 | SceneManager.Close(); |
902 | |||
903 | foreach (IApplicationPlugin plugin in m_plugins) | ||
904 | plugin.Dispose(); | ||
881 | } | 905 | } |
882 | catch (Exception e) | 906 | catch (Exception e) |
883 | { | 907 | { |