diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3343d08..be01d44 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4984,5 +4984,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
4984 | throw new Exception(error); | 4984 | throw new Exception(error); |
4985 | } | 4985 | } |
4986 | } | 4986 | } |
4987 | |||
4988 | public void CleanDroppedAttachments() | ||
4989 | { | ||
4990 | List<SceneObjectGroup> objectsToDelete = | ||
4991 | new List<SceneObjectGroup>(); | ||
4992 | |||
4993 | ForEachSOG(delegate (SceneObjectGroup grp) | ||
4994 | { | ||
4995 | if (grp.RootPart.Shape.State != 0) | ||
4996 | { | ||
4997 | UUID agentID = grp.OwnerID; | ||
4998 | if (agentID == UUID.Zero) | ||
4999 | { | ||
5000 | objectsToDelete.Add(grp); | ||
5001 | return; | ||
5002 | } | ||
5003 | |||
5004 | ScenePresence sp = GetScenePresence(agentID); | ||
5005 | if (sp == null) | ||
5006 | { | ||
5007 | objectsToDelete.Add(grp); | ||
5008 | return; | ||
5009 | } | ||
5010 | } | ||
5011 | }); | ||
5012 | |||
5013 | foreach (SceneObjectGroup grp in objectsToDelete) | ||
5014 | { | ||
5015 | m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); | ||
5016 | DeleteSceneObject(grp, true); | ||
5017 | } | ||
5018 | } | ||
4987 | } | 5019 | } |
4988 | } | 5020 | } |