/// <summary>
/// Delete the given object from the scene
/// </summary>
public void DeleteToInventory(DeRezAction action, UUID folderID,
List <SceneObjectGroup> objectGroups, IClientAPI remoteClient,
bool permissionToDelete)
{
if (Enabled)
{
lock (m_inventoryTicker)
m_inventoryTicker.Stop();
}
lock (m_inventoryDeletes)
{
DeleteToInventoryHolder dtis = new DeleteToInventoryHolder();
dtis.action = action;
dtis.folderID = folderID;
dtis.objectGroups = objectGroups;
dtis.remoteClient = remoteClient;
dtis.permissionToDelete = permissionToDelete;
m_inventoryDeletes.Enqueue(dtis);
}
if (Enabled)
{
lock (m_inventoryTicker)
m_inventoryTicker.Start();
}
// Visually remove it, even if it isnt really gone yet. This means that if we crash before the object
// has gone to inventory, it will reappear in the region again on restart instead of being lost.
// This is not ideal since the object will still be available for manipulation when it should be, but it's
// better than losing the object for now.
if (permissionToDelete)
{
List <uint> killIDs = new List <uint>();
foreach (SceneObjectGroup g in objectGroups)
{
killIDs.Add(g.LocalId);
g.DeleteGroupFromScene(true);
}
m_scene.SendKillObject(killIDs);
}
}