Add two events: OnAttachToBackup and OnDetachFromBackup.
parent
8daa149c36
commit
96e649189f
|
@ -43,6 +43,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone);
|
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 ObjectCreateDelegate(EntityBase obj);
|
||||||
|
|
||||||
public delegate void ObjectDeleteDelegate(EntityBase obj);
|
public delegate void ObjectDeleteDelegate(EntityBase obj);
|
||||||
|
@ -61,6 +65,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private PhysicsCrash handlerPhysicsCrash = null;
|
private PhysicsCrash handlerPhysicsCrash = null;
|
||||||
|
|
||||||
public event ObjectDuplicateDelegate OnObjectDuplicate;
|
public event ObjectDuplicateDelegate OnObjectDuplicate;
|
||||||
|
public event AttachToBackupDelegate OnAttachToBackup;
|
||||||
|
public event DetachFromBackupDelegate OnDetachFromBackup;
|
||||||
public event ObjectCreateDelegate OnObjectCreate;
|
public event ObjectCreateDelegate OnObjectCreate;
|
||||||
public event ObjectDeleteDelegate OnObjectRemove;
|
public event ObjectDeleteDelegate OnObjectRemove;
|
||||||
|
|
||||||
|
@ -388,10 +394,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_numPrim += sceneObject.Children.Count;
|
m_numPrim += sceneObject.Children.Count;
|
||||||
|
|
||||||
if (attachToBackup)
|
if (attachToBackup)
|
||||||
|
{
|
||||||
sceneObject.AttachToBackup();
|
sceneObject.AttachToBackup();
|
||||||
|
}
|
||||||
|
|
||||||
if (OnObjectCreate != null)
|
if (OnObjectCreate != null)
|
||||||
|
{
|
||||||
OnObjectCreate(sceneObject);
|
OnObjectCreate(sceneObject);
|
||||||
|
}
|
||||||
|
|
||||||
lock (m_dictionary_lock)
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process all pending updates
|
/// Process all pending updates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -658,6 +658,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void AttachToBackup()
|
public virtual void AttachToBackup()
|
||||||
{
|
{
|
||||||
|
m_scene.SceneGraph.FireAttachToBackup(this);
|
||||||
|
|
||||||
if (InSceneBackup)
|
if (InSceneBackup)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat(
|
//m_log.DebugFormat(
|
||||||
|
@ -2703,6 +2705,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="objectGroup"></param>
|
/// <param name="objectGroup"></param>
|
||||||
public virtual void DetachFromBackup()
|
public virtual void DetachFromBackup()
|
||||||
{
|
{
|
||||||
|
m_scene.SceneGraph.FireDetachFromBackup(this);
|
||||||
|
|
||||||
if (m_isBackedUp)
|
if (m_isBackedUp)
|
||||||
m_scene.EventManager.OnBackup -= ProcessBackup;
|
m_scene.EventManager.OnBackup -= ProcessBackup;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue