diff options
author | Melanie Thielker | 2010-08-24 18:20:24 +0200 |
---|---|---|
committer | Melanie | 2010-11-08 02:36:51 +0000 |
commit | 2317b6767beb1c171a8a9b087510ad4111ec0a01 (patch) | |
tree | c75c523087b124bd7d747f3b8a980e37c0c41ea3 /OpenSim/Region/Framework | |
parent | Detach attachments displaced by other attachments (diff) | |
download | opensim-SC_OLD-2317b6767beb1c171a8a9b087510ad4111ec0a01.zip opensim-SC_OLD-2317b6767beb1c171a8a9b087510ad4111ec0a01.tar.gz opensim-SC_OLD-2317b6767beb1c171a8a9b087510ad4111ec0a01.tar.bz2 opensim-SC_OLD-2317b6767beb1c171a8a9b087510ad4111ec0a01.tar.xz |
Add a method to delete left over / dropped attachments
Diffstat (limited to '')
-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 | } |