aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
2 files changed, 27 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}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1d2092e..5085396 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1091,6 +1091,8 @@ namespace OpenSim.Region.Framework.Scenes
1091 shuttingdown = true; 1091 shuttingdown = true;
1092 1092
1093 m_log.Debug("[SCENE]: Persisting changed objects"); 1093 m_log.Debug("[SCENE]: Persisting changed objects");
1094 EventManager.TriggerSceneShuttingDown(this);
1095
1094 EntityBase[] entities = GetEntities(); 1096 EntityBase[] entities = GetEntities();
1095 foreach (EntityBase entity in entities) 1097 foreach (EntityBase entity in entities)
1096 { 1098 {