diff options
author | Melanie Thielker | 2010-06-26 06:17:09 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-06-26 06:17:09 +0200 |
commit | 06fd49bda933194291a7c351c8382dd7036bb30e (patch) | |
tree | 18e45591993fc03020f31f404352270fb06a89f4 /OpenSim/Region/Framework | |
parent | Fix loading of attachments on login (diff) | |
parent | Add new event: OnChangedBackup (diff) | |
download | opensim-SC-06fd49bda933194291a7c351c8382dd7036bb30e.zip opensim-SC-06fd49bda933194291a7c351c8382dd7036bb30e.tar.gz opensim-SC-06fd49bda933194291a7c351c8382dd7036bb30e.tar.bz2 opensim-SC-06fd49bda933194291a7c351c8382dd7036bb30e.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 37 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 |
2 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 06bc5cd..81ef54f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -43,6 +43,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
43 | 43 | ||
44 | public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone); | 44 | public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone); |
45 | 45 | ||
46 | public delegate void AttachToBackupDelegate(SceneObjectGroup sog); | ||
47 | |||
48 | public delegate void DetachFromBackupDelegate(SceneObjectGroup sog); | ||
49 | |||
50 | public delegate void ChangedBackupDelegate(SceneObjectGroup sog); | ||
51 | |||
46 | public delegate void ObjectCreateDelegate(EntityBase obj); | 52 | public delegate void ObjectCreateDelegate(EntityBase obj); |
47 | 53 | ||
48 | public delegate void ObjectDeleteDelegate(EntityBase obj); | 54 | public delegate void ObjectDeleteDelegate(EntityBase obj); |
@@ -61,6 +67,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
61 | private PhysicsCrash handlerPhysicsCrash = null; | 67 | private PhysicsCrash handlerPhysicsCrash = null; |
62 | 68 | ||
63 | public event ObjectDuplicateDelegate OnObjectDuplicate; | 69 | public event ObjectDuplicateDelegate OnObjectDuplicate; |
70 | public event AttachToBackupDelegate OnAttachToBackup; | ||
71 | public event DetachFromBackupDelegate OnDetachFromBackup; | ||
72 | public event ChangedBackupDelegate OnChangeBackup; | ||
64 | public event ObjectCreateDelegate OnObjectCreate; | 73 | public event ObjectCreateDelegate OnObjectCreate; |
65 | public event ObjectDeleteDelegate OnObjectRemove; | 74 | public event ObjectDeleteDelegate OnObjectRemove; |
66 | 75 | ||
@@ -388,10 +397,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
388 | m_numPrim += sceneObject.Children.Count; | 397 | m_numPrim += sceneObject.Children.Count; |
389 | 398 | ||
390 | if (attachToBackup) | 399 | if (attachToBackup) |
400 | { | ||
391 | sceneObject.AttachToBackup(); | 401 | sceneObject.AttachToBackup(); |
402 | } | ||
392 | 403 | ||
393 | if (OnObjectCreate != null) | 404 | if (OnObjectCreate != null) |
405 | { | ||
394 | OnObjectCreate(sceneObject); | 406 | OnObjectCreate(sceneObject); |
407 | } | ||
395 | 408 | ||
396 | lock (m_dictionary_lock) | 409 | lock (m_dictionary_lock) |
397 | { | 410 | { |
@@ -458,6 +471,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
458 | } | 471 | } |
459 | } | 472 | } |
460 | 473 | ||
474 | public void FireAttachToBackup(SceneObjectGroup obj) | ||
475 | { | ||
476 | if (OnAttachToBackup != null) | ||
477 | { | ||
478 | OnAttachToBackup(obj); | ||
479 | } | ||
480 | } | ||
481 | |||
482 | public void FireDetachFromBackup(SceneObjectGroup obj) | ||
483 | { | ||
484 | if (OnDetachFromBackup != null) | ||
485 | { | ||
486 | OnDetachFromBackup(obj); | ||
487 | } | ||
488 | } | ||
489 | |||
490 | public void FireChangeBackup(SceneObjectGroup obj) | ||
491 | { | ||
492 | if (OnChangeBackup != null) | ||
493 | { | ||
494 | OnChangeBackup(obj); | ||
495 | } | ||
496 | } | ||
497 | |||
461 | /// <summary> | 498 | /// <summary> |
462 | /// Process all pending updates | 499 | /// Process all pending updates |
463 | /// </summary> | 500 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3e92954..7081ced 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -200,6 +200,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
200 | { | 200 | { |
201 | if (value) | 201 | if (value) |
202 | { | 202 | { |
203 | if (m_isBackedUp) | ||
204 | { | ||
205 | m_scene.SceneGraph.FireChangeBackup(this); | ||
206 | } | ||
203 | timeLastChanged = DateTime.Now.Ticks; | 207 | timeLastChanged = DateTime.Now.Ticks; |
204 | if (!m_hasGroupChanged) | 208 | if (!m_hasGroupChanged) |
205 | timeFirstChanged = DateTime.Now.Ticks; | 209 | timeFirstChanged = DateTime.Now.Ticks; |
@@ -658,6 +662,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
658 | /// </summary> | 662 | /// </summary> |
659 | public virtual void AttachToBackup() | 663 | public virtual void AttachToBackup() |
660 | { | 664 | { |
665 | m_scene.SceneGraph.FireAttachToBackup(this); | ||
666 | |||
661 | if (InSceneBackup) | 667 | if (InSceneBackup) |
662 | { | 668 | { |
663 | //m_log.DebugFormat( | 669 | //m_log.DebugFormat( |
@@ -2703,6 +2709,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2703 | /// <param name="objectGroup"></param> | 2709 | /// <param name="objectGroup"></param> |
2704 | public virtual void DetachFromBackup() | 2710 | public virtual void DetachFromBackup() |
2705 | { | 2711 | { |
2712 | m_scene.SceneGraph.FireDetachFromBackup(this); | ||
2713 | |||
2706 | if (m_isBackedUp) | 2714 | if (m_isBackedUp) |
2707 | m_scene.EventManager.OnBackup -= ProcessBackup; | 2715 | m_scene.EventManager.OnBackup -= ProcessBackup; |
2708 | 2716 | ||