mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Add a method to delete left over / dropped attachments
This commit is contained in:
@@ -5040,5 +5040,37 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
throw new Exception(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void CleanDroppedAttachments()
|
||||
{
|
||||
List<SceneObjectGroup> objectsToDelete =
|
||||
new List<SceneObjectGroup>();
|
||||
|
||||
ForEachSOG(delegate (SceneObjectGroup grp)
|
||||
{
|
||||
if (grp.RootPart.Shape.State != 0)
|
||||
{
|
||||
UUID agentID = grp.OwnerID;
|
||||
if (agentID == UUID.Zero)
|
||||
{
|
||||
objectsToDelete.Add(grp);
|
||||
return;
|
||||
}
|
||||
|
||||
ScenePresence sp = GetScenePresence(agentID);
|
||||
if (sp == null)
|
||||
{
|
||||
objectsToDelete.Add(grp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
foreach (SceneObjectGroup grp in objectsToDelete)
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);
|
||||
DeleteSceneObject(grp, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user