From 96e649189f24b6261d0bcdd6aa7f5a078b8d3f7f Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Fri, 25 Jun 2010 14:25:39 -0700 Subject: Add two events: OnAttachToBackup and OnDetachFromBackup. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 80f9114..904e38a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -43,6 +43,10 @@ namespace OpenSim.Region.Framework.Scenes public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone); + public delegate void AttachToBackupDelegate(SceneObjectGroup sog); + + public delegate void DetachFromBackupDelegate(SceneObjectGroup sog); + public delegate void ObjectCreateDelegate(EntityBase obj); public delegate void ObjectDeleteDelegate(EntityBase obj); @@ -61,6 +65,8 @@ namespace OpenSim.Region.Framework.Scenes private PhysicsCrash handlerPhysicsCrash = null; public event ObjectDuplicateDelegate OnObjectDuplicate; + public event AttachToBackupDelegate OnAttachToBackup; + public event DetachFromBackupDelegate OnDetachFromBackup; public event ObjectCreateDelegate OnObjectCreate; public event ObjectDeleteDelegate OnObjectRemove; @@ -388,10 +394,14 @@ namespace OpenSim.Region.Framework.Scenes m_numPrim += sceneObject.Children.Count; if (attachToBackup) + { sceneObject.AttachToBackup(); + } if (OnObjectCreate != null) + { OnObjectCreate(sceneObject); + } lock (m_dictionary_lock) { @@ -458,6 +468,22 @@ namespace OpenSim.Region.Framework.Scenes } } + public void FireAttachToBackup(SceneObjectGroup obj) + { + if (OnAttachToBackup != null) + { + OnAttachToBackup(obj); + } + } + + public void FireDetachFromBackup(SceneObjectGroup obj) + { + if (OnDetachFromBackup != null) + { + OnDetachFromBackup(obj); + } + } + /// /// Process all pending updates /// -- cgit v1.1