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 fd62535..e04317b 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -111,6 +111,10 @@ namespace OpenSim.Region.Framework.Scenes
111 111
112 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; 112 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
113 113
114 public delegate void SceneShuttingDownDelegate(Scene scene);
115
116 public event SceneShuttingDownDelegate OnSceneShuttingDown;
117
114 /// <summary> 118 /// <summary>
115 /// Fired when an object is touched/grabbed. 119 /// Fired when an object is touched/grabbed.
116 /// </summary> 120 /// </summary>
@@ -2193,5 +2197,26 @@ namespace OpenSim.Region.Framework.Scenes
2193 } 2197 }
2194 } 2198 }
2195 } 2199 }
2200
2201 public void TriggerSceneShuttingDown(Scene s)
2202 {
2203 SceneShuttingDownDelegate handler = OnSceneShuttingDown;
2204 if (handler != null)
2205 {
2206 foreach (SceneShuttingDownDelegate d in handler.GetInvocationList())
2207 {
2208 try
2209 {
2210 d(s);
2211 }
2212 catch (Exception e)
2213 {
2214 m_log.ErrorFormat(
2215 "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}",
2216 e.Message, e.StackTrace);
2217 }
2218 }
2219 }
2220 }
2196 } 2221 }
2197} 2222}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b9690fe..eabc9a6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1064,6 +1064,8 @@ namespace OpenSim.Region.Framework.Scenes
1064 shuttingdown = true; 1064 shuttingdown = true;
1065 1065
1066 m_log.Debug("[SCENE]: Persisting changed objects"); 1066 m_log.Debug("[SCENE]: Persisting changed objects");
1067 EventManager.TriggerSceneShuttingDown(this);
1068
1067 EntityBase[] entities = GetEntities(); 1069 EntityBase[] entities = GetEntities();
1068 foreach (EntityBase entity in entities) 1070 foreach (EntityBase entity in entities)
1069 { 1071 {