aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2010-08-24 18:20:24 +0200
committerMelanie Thielker2010-08-24 18:20:24 +0200
commitb9e12ed3b7e6f33a824129ce6e79519140a34aa2 (patch)
treee1a0f53beb03ea26278f4ef1ea614cf079fc051c /OpenSim
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-b9e12ed3b7e6f33a824129ce6e79519140a34aa2.zip
opensim-SC_OLD-b9e12ed3b7e6f33a824129ce6e79519140a34aa2.tar.gz
opensim-SC_OLD-b9e12ed3b7e6f33a824129ce6e79519140a34aa2.tar.bz2
opensim-SC_OLD-b9e12ed3b7e6f33a824129ce6e79519140a34aa2.tar.xz
Add a method to delete left over / dropped attachments
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 957c4e8..d0619d7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5040,5 +5040,37 @@ namespace OpenSim.Region.Framework.Scenes
5040 throw new Exception(error); 5040 throw new Exception(error);
5041 } 5041 }
5042 } 5042 }
5043
5044 public void CleanDroppedAttachments()
5045 {
5046 List<SceneObjectGroup> objectsToDelete =
5047 new List<SceneObjectGroup>();
5048
5049 ForEachSOG(delegate (SceneObjectGroup grp)
5050 {
5051 if (grp.RootPart.Shape.State != 0)
5052 {
5053 UUID agentID = grp.OwnerID;
5054 if (agentID == UUID.Zero)
5055 {
5056 objectsToDelete.Add(grp);
5057 return;
5058 }
5059
5060 ScenePresence sp = GetScenePresence(agentID);
5061 if (sp == null)
5062 {
5063 objectsToDelete.Add(grp);
5064 return;
5065 }
5066 }
5067 });
5068
5069 foreach (SceneObjectGroup grp in objectsToDelete)
5070 {
5071 m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);
5072 DeleteSceneObject(grp, true);
5073 }
5074 }
5043 } 5075 }
5044} 5076}