aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/EventManager.cs
diff options
context:
space:
mode:
authorMelanie2011-05-24 00:53:28 +0200
committerMelanie2011-05-24 00:53:28 +0200
commit8b42f824d3ccd487e1d0917b155faa75fd311927 (patch)
tree9b491340f001f8c1ba56588dcd785d20bba1a092 /OpenSim/Region/Framework/Scenes/EventManager.cs
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC-8b42f824d3ccd487e1d0917b155faa75fd311927.zip
opensim-SC-8b42f824d3ccd487e1d0917b155faa75fd311927.tar.gz
opensim-SC-8b42f824d3ccd487e1d0917b155faa75fd311927.tar.bz2
opensim-SC-8b42f824d3ccd487e1d0917b155faa75fd311927.tar.xz
Add an event for an orderly region shutdown that fires once per region before
the SceneGraph is torn down.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 4ce7a6c..d326141 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -115,6 +115,10 @@ namespace OpenSim.Region.Framework.Scenes
115 115
116 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; 116 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
117 117
118 public delegate void SceneShuttingDownDelegate(Scene scene);
119
120 public event SceneShuttingDownDelegate OnSceneShuttingDown;
121
118 /// <summary> 122 /// <summary>
119 /// Fired when an object is touched/grabbed. 123 /// Fired when an object is touched/grabbed.
120 /// </summary> 124 /// </summary>
@@ -2217,5 +2221,26 @@ namespace OpenSim.Region.Framework.Scenes
2217 } 2221 }
2218 } 2222 }
2219 } 2223 }
2224
2225 public void TriggerSceneShuttingDown(Scene s)
2226 {
2227 SceneShuttingDownDelegate handler = OnSceneShuttingDown;
2228 if (handler != null)
2229 {
2230 foreach (SceneShuttingDownDelegate d in handler.GetInvocationList())
2231 {
2232 try
2233 {
2234 d(s);
2235 }
2236 catch (Exception e)
2237 {
2238 m_log.ErrorFormat(
2239 "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}",
2240 e.Message, e.StackTrace);
2241 }
2242 }
2243 }
2244 }
2220 } 2245 }
2221} 2246}