29 using System.Collections.Generic;
30 using System.Reflection;
34 using OpenSim.Framework;
35 using OpenSim.Region.Framework.Interfaces;
37 namespace OpenSim.
Region.Framework.Scenes
54 private static readonly ILog m_log
55 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62 private Timer m_inventoryTicker =
new Timer(2000);
63 private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes =
new Queue<DeleteToInventoryHolder>();
64 private Scene m_scene;
70 m_inventoryTicker.AutoReset =
false;
71 m_inventoryTicker.Elapsed += InventoryRunDeleteTimer;
78 List<SceneObjectGroup> objectGroups,
IClientAPI remoteClient,
79 bool permissionToDelete)
82 lock (m_inventoryTicker)
83 m_inventoryTicker.Stop();
85 lock (m_inventoryDeletes)
89 dtis.folderID = folderID;
90 dtis.objectGroups = objectGroups;
91 dtis.remoteClient = remoteClient;
92 dtis.permissionToDelete = permissionToDelete;
94 m_inventoryDeletes.Enqueue(dtis);
98 lock (m_inventoryTicker)
99 m_inventoryTicker.Start();
105 if (permissionToDelete)
108 g.DeleteGroupFromScene(
false);
112 private void InventoryRunDeleteTimer(
object sender, ElapsedEventArgs e)
119 Culture.SetCurrentCulture();
121 while (InventoryDeQueueAndDelete())
137 lock (m_inventoryDeletes)
139 int left = m_inventoryDeletes.Count;
142 x = m_inventoryDeletes.Dequeue();
151 if (invAccess != null)
152 invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient,
false);
157 m_scene.DeleteSceneObject(g,
true);
163 "[ASYNC DELETER]: Exception background sending object: {0}{1}", e.Message, e.StackTrace);
175 "[ASYNC DELETER]: Queued sending of scene object to agent {0} {1} failed: {2} {3}",
176 (x != null ? x.remoteClient.Name :
"unavailable"),
Asynchronously derez objects. This is used to derez large number of objects to inventory without hold...
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
bool InventoryDeQueueAndDelete()
Move the next object in the queue to inventory. Then delete it properly from the scene.
AsyncSceneObjectGroupDeleter(Scene scene)
System.Timers.Timer Timer
void DeleteToInventory(DeRezAction action, UUID folderID, List< SceneObjectGroup > objectGroups, IClientAPI remoteClient, bool permissionToDelete)
Delete the given object from the scene
List< SceneObjectGroup > objectGroups