aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-31 17:53:58 +0100
committerJustin Clark-Casey (justincc)2011-08-31 17:53:58 +0100
commit7d58b5fa157b4c3e842573d9fb02a9822034f4b0 (patch)
treeb726d3c045a2ccbad3530b27c00e8a03027f5548 /OpenSim/Region/Framework
parentIf a FireAndForget thread terminates with an exception, then catch and log ra... (diff)
downloadopensim-SC_OLD-7d58b5fa157b4c3e842573d9fb02a9822034f4b0.zip
opensim-SC_OLD-7d58b5fa157b4c3e842573d9fb02a9822034f4b0.tar.gz
opensim-SC_OLD-7d58b5fa157b4c3e842573d9fb02a9822034f4b0.tar.bz2
opensim-SC_OLD-7d58b5fa157b4c3e842573d9fb02a9822034f4b0.tar.xz
move common code into AttachmentsModule.DeleteAttachmentsFromScene()
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs9
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScenePresence.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs14
3 files changed, 25 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index ce795f1..dd11ded 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -48,6 +48,15 @@ namespace OpenSim.Region.Framework.Interfaces
48 void SaveChangedAttachments(IScenePresence sp); 48 void SaveChangedAttachments(IScenePresence sp);
49 49
50 /// <summary> 50 /// <summary>
51 /// Delete all the presence's attachments from the scene
52 /// </summary>
53 /// <param name="sp">
54 /// This is done when a root agent leaves/is demoted to child (for instance, on logout, teleport or region cross).
55 /// </param>
56 /// <param name="silent"></param>
57 void DeleteAttachmentsFromScene(IScenePresence sp, bool silent);
58
59 /// <summary>
51 /// Attach an object to an avatar from the world. 60 /// Attach an object to an avatar from the world.
52 /// </summary> 61 /// </summary>
53 /// <param name="controllingClient"></param> 62 /// <param name="controllingClient"></param>
diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
index 788b36f..91e4bf2 100644
--- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
@@ -62,9 +62,22 @@ namespace OpenSim.Region.Framework.Interfaces
62 /// A copy of the list. 62 /// A copy of the list.
63 /// </returns> 63 /// </returns>
64 /// <remarks> 64 /// <remarks>
65 /// Do not change this list directly - use methods such as 65 /// Do not change this list directly - use the attachments module.
66 /// AddAttachment() and RemoveAttachment().
67 /// </remarks> 66 /// </remarks>
68 List<SceneObjectGroup> GetAttachments(); 67 List<SceneObjectGroup> GetAttachments();
68
69 /// <summary>
70 /// The scene objects attached to this avatar at a specific attachment point.
71 /// </summary>
72 /// <param name="attachmentPoint"></param>
73 /// <returns></returns>
74 List<SceneObjectGroup> GetAttachments(uint attachmentPoint);
75
76 bool HasAttachments();
77
78 // Don't use these methods directly. Instead, use the AttachmentsModule
79 void AddAttachment(SceneObjectGroup gobj);
80 void RemoveAttachment(SceneObjectGroup gobj);
81 void ClearAttachments();
69 } 82 }
70} \ No newline at end of file 83} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 5e96b0a..0d284a5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3401,19 +3401,7 @@ namespace OpenSim.Region.Framework.Scenes
3401 3401
3402 public void Close() 3402 public void Close()
3403 { 3403 {
3404 lock (m_attachments) 3404 m_scene.AttachmentsModule.DeleteAttachmentsFromScene(this, false);
3405 {
3406 // Delete attachments from scene
3407 // Don't try to save, as this thread won't live long
3408 // enough to complete the save. This would cause no copy
3409 // attachments to poof!
3410 //
3411 foreach (SceneObjectGroup grp in m_attachments)
3412 {
3413 m_scene.DeleteSceneObject(grp, false);
3414 }
3415 m_attachments.Clear();
3416 }
3417 3405
3418 lock (m_knownChildRegions) 3406 lock (m_knownChildRegions)
3419 { 3407 {