aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3343d08..3576a88 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3162,6 +3162,9 @@ namespace OpenSim.Region.Framework.Scenes
3162 } 3162 }
3163 3163
3164 m_eventManager.TriggerOnRemovePresence(agentID); 3164 m_eventManager.TriggerOnRemovePresence(agentID);
3165
3166 CleanDroppedAttachments();
3167
3165 ForEachClient( 3168 ForEachClient(
3166 delegate(IClientAPI client) 3169 delegate(IClientAPI client)
3167 { 3170 {
@@ -3408,6 +3411,8 @@ namespace OpenSim.Region.Framework.Scenes
3408 3411
3409 if (vialogin) 3412 if (vialogin)
3410 { 3413 {
3414 CleanDroppedAttachments();
3415
3411 if (TestBorderCross(agent.startpos, Cardinals.E)) 3416 if (TestBorderCross(agent.startpos, Cardinals.E))
3412 { 3417 {
3413 Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); 3418 Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
@@ -4984,5 +4989,36 @@ namespace OpenSim.Region.Framework.Scenes
4984 throw new Exception(error); 4989 throw new Exception(error);
4985 } 4990 }
4986 } 4991 }
4992
4993 public void CleanDroppedAttachments()
4994 {
4995 List<SceneObjectGroup> objectsToDelete =
4996 new List<SceneObjectGroup>();
4997
4998 ForEachSOG(delegate (SceneObjectGroup grp)
4999 {
5000 if (grp.RootPart.Shape.State != 0)
5001 {
5002 if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp)))
5003 {
5004 objectsToDelete.Add(grp);
5005 return;
5006 }
5007
5008 ScenePresence sp = GetScenePresence(agentID);
5009 if (sp == null)
5010 {
5011 objectsToDelete.Add(grp);
5012 return;
5013 }
5014 }
5015 });
5016
5017 foreach (SceneObjectGroup grp in objectsToDelete)
5018 {
5019 m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);
5020 DeleteSceneObject(grp, true);
5021 }
5022 }
4987 } 5023 }
4988} 5024}