Add a method to delete left over / dropped attachments
parent
483fc88b07
commit
b9e12ed3b7
|
@ -5040,5 +5040,37 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
throw new Exception(error);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue