aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-02 23:48:44 +0100
committerJustin Clark-Casey2014-08-02 00:50:10 +0100
commitba745a524d4f13552f8ed3827a7315b3000cbe53 (patch)
treee0242a1495d2d3119a3559181186a1e16d61fd0a /OpenSim/Region/Application/OpenSimBase.cs
parentminor: Change default max phys prim size in code to match OpenSimDefaults.ini (diff)
downloadopensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.zip
opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.tar.gz
opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.tar.bz2
opensim-SC_OLD-ba745a524d4f13552f8ed3827a7315b3000cbe53.tar.xz
Actually call Close() for shared region modules when the simulator is being shutdown.
Adds regression test for this case.
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs44
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 {