aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-07-26 20:13:26 +0100
committerJustin Clark-Casey (justincc)2010-07-26 20:13:26 +0100
commit491b8181ad4fcb0a8002ee2406703b89c4928219 (patch)
tree13f60a62904e1993c36baf6a3f88af95a68bc5cc /OpenSim/Region/Framework/Scenes
parentPut a wrapper around the media texture region serialization (diff)
downloadopensim-SC-491b8181ad4fcb0a8002ee2406703b89c4928219.zip
opensim-SC-491b8181ad4fcb0a8002ee2406703b89c4928219.tar.gz
opensim-SC-491b8181ad4fcb0a8002ee2406703b89c4928219.tar.bz2
opensim-SC-491b8181ad4fcb0a8002ee2406703b89c4928219.tar.xz
Add EventManager.OnSceneObjectLoaded() for future use. This is fired immediately after a scene object is loaded from storage.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs32
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
2 files changed, 33 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index ef125cd..46e17c5 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -331,9 +331,16 @@ namespace OpenSim.Region.Framework.Scenes
331 /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical). 331 /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical).
332 public delegate void Attach(uint localID, UUID itemID, UUID avatarID); 332 public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
333 public event Attach OnAttach; 333 public event Attach OnAttach;
334
335 public delegate void SceneObjectDelegate(SceneObjectGroup so);
336
337 /// <summary>
338 /// Called immediately after an object is loaded from storage.
339 /// </summary>
340 public event SceneObjectDelegate OnSceneObjectLoaded;
334 341
335 public delegate void RegionUp(GridRegion region); 342 public delegate void RegionUp(GridRegion region);
336 public event RegionUp OnRegionUp; 343 public event RegionUp OnRegionUp;
337 344
338 public class MoneyTransferArgs : EventArgs 345 public class MoneyTransferArgs : EventArgs
339 { 346 {
@@ -2013,5 +2020,26 @@ namespace OpenSim.Region.Framework.Scenes
2013 } 2020 }
2014 } 2021 }
2015 } 2022 }
2023
2024 public void TriggerOnSceneObjectLoaded(SceneObjectGroup so)
2025 {
2026 SceneObjectDelegate handler = OnSceneObjectLoaded;
2027 if (handler != null)
2028 {
2029 foreach (SceneObjectDelegate d in handler.GetInvocationList())
2030 {
2031 try
2032 {
2033 d(so);
2034 }
2035 catch (Exception e)
2036 {
2037 m_log.ErrorFormat(
2038 "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}",
2039 e.Message, e.StackTrace);
2040 }
2041 }
2042 }
2043 }
2016 } 2044 }
2017} 2045} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e2ab643..5542a0c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1887,9 +1887,11 @@ namespace OpenSim.Region.Framework.Scenes
1887 1887
1888 foreach (SceneObjectGroup group in PrimsFromDB) 1888 foreach (SceneObjectGroup group in PrimsFromDB)
1889 { 1889 {
1890 EventManager.TriggerOnSceneObjectLoaded(group);
1891
1890 if (group.RootPart == null) 1892 if (group.RootPart == null)
1891 { 1893 {
1892 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children", 1894 m_log.ErrorFormat("[SCENE]: Found a SceneObjectGroup with m_rootPart == null and {0} children",
1893 group.Children == null ? 0 : group.Children.Count); 1895 group.Children == null ? 0 : group.Children.Count);
1894 } 1896 }
1895 1897