diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 11a0146..7509686 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -44,29 +44,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
44 | public UUID folderID; | 44 | public UUID folderID; |
45 | public bool permissionToDelete; | 45 | public bool permissionToDelete; |
46 | } | 46 | } |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Asynchronously derez objects. This is used to derez large number of objects to inventory without holding | 49 | /// Asynchronously derez objects. This is used to derez large number of objects to inventory without holding |
50 | /// up the main client thread. | 50 | /// up the main client thread. |
51 | /// </summary> | 51 | /// </summary> |
52 | public class AsyncSceneObjectGroupDeleter | 52 | public class AsyncSceneObjectGroupDeleter |
53 | { | 53 | { |
54 | private static readonly ILog m_log | 54 | private static readonly ILog m_log |
55 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 55 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
56 | 56 | ||
57 | /// <value> | 57 | /// <value> |
58 | /// Is the deleter currently enabled? | 58 | /// Is the deleter currently enabled? |
59 | /// </value> | 59 | /// </value> |
60 | public bool Enabled; | 60 | public bool Enabled; |
61 | 61 | ||
62 | private Timer m_inventoryTicker = new Timer(2000); | 62 | private Timer m_inventoryTicker = new Timer(2000); |
63 | private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>(); | 63 | private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>(); |
64 | private Scene m_scene; | 64 | private Scene m_scene; |
65 | 65 | ||
66 | public AsyncSceneObjectGroupDeleter(Scene scene) | 66 | public AsyncSceneObjectGroupDeleter(Scene scene) |
67 | { | 67 | { |
68 | m_scene = scene; | 68 | m_scene = scene; |
69 | 69 | ||
70 | m_inventoryTicker.AutoReset = false; | 70 | m_inventoryTicker.AutoReset = false; |
71 | m_inventoryTicker.Elapsed += InventoryRunDeleteTimer; | 71 | m_inventoryTicker.Elapsed += InventoryRunDeleteTimer; |
72 | } | 72 | } |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
75 | /// Delete the given object from the scene | 75 | /// Delete the given object from the scene |
76 | /// </summary> | 76 | /// </summary> |
77 | public void DeleteToInventory(DeRezAction action, UUID folderID, | 77 | public void DeleteToInventory(DeRezAction action, UUID folderID, |
78 | List<SceneObjectGroup> objectGroups, IClientAPI remoteClient, | 78 | List<SceneObjectGroup> objectGroups, IClientAPI remoteClient, |
79 | bool permissionToDelete) | 79 | bool permissionToDelete) |
80 | { | 80 | { |
81 | if (Enabled) | 81 | if (Enabled) |
@@ -97,7 +97,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
97 | if (Enabled) | 97 | if (Enabled) |
98 | lock (m_inventoryTicker) | 98 | lock (m_inventoryTicker) |
99 | m_inventoryTicker.Start(); | 99 | m_inventoryTicker.Start(); |
100 | 100 | ||
101 | // Visually remove it, even if it isnt really gone yet. This means that if we crash before the object | 101 | // Visually remove it, even if it isnt really gone yet. This means that if we crash before the object |
102 | // has gone to inventory, it will reappear in the region again on restart instead of being lost. | 102 | // has gone to inventory, it will reappear in the region again on restart instead of being lost. |
103 | // This is not ideal since the object will still be available for manipulation when it should be, but it's | 103 | // This is not ideal since the object will still be available for manipulation when it should be, but it's |
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
108 | g.DeleteGroupFromScene(false); | 108 | g.DeleteGroupFromScene(false); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) | 112 | private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) |
113 | { | 113 | { |
114 | // m_log.Debug("[ASYNC DELETER]: Starting send to inventory loop"); | 114 | // m_log.Debug("[ASYNC DELETER]: Starting send to inventory loop"); |
@@ -116,8 +116,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
116 | // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved | 116 | // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved |
117 | // in a culture where decimal points are commas and then reloaded in a culture which just treats them as | 117 | // in a culture where decimal points are commas and then reloaded in a culture which just treats them as |
118 | // number seperators. | 118 | // number seperators. |
119 | Culture.SetCurrentCulture(); | 119 | Culture.SetCurrentCulture(); |
120 | 120 | ||
121 | while (InventoryDeQueueAndDelete()) | 121 | while (InventoryDeQueueAndDelete()) |
122 | { | 122 | { |
123 | //m_log.Debug("[ASYNC DELETER]: Sent item successfully to inventory, continuing..."); | 123 | //m_log.Debug("[ASYNC DELETER]: Sent item successfully to inventory, continuing..."); |
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
131 | public bool InventoryDeQueueAndDelete() | 131 | public bool InventoryDeQueueAndDelete() |
132 | { | 132 | { |
133 | DeleteToInventoryHolder x = null; | 133 | DeleteToInventoryHolder x = null; |
134 | 134 | ||
135 | try | 135 | try |
136 | { | 136 | { |
137 | lock (m_inventoryDeletes) | 137 | lock (m_inventoryDeletes) |
@@ -144,13 +144,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
144 | // m_log.DebugFormat( | 144 | // m_log.DebugFormat( |
145 | // "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", | 145 | // "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", |
146 | // left, x.action, x.objectGroups.Count); | 146 | // left, x.action, x.objectGroups.Count); |
147 | 147 | ||
148 | try | 148 | try |
149 | { | 149 | { |
150 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 150 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
151 | if (invAccess != null) | 151 | if (invAccess != null) |
152 | invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient, false); | 152 | invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient, false); |
153 | 153 | ||
154 | if (x.permissionToDelete) | 154 | if (x.permissionToDelete) |
155 | { | 155 | { |
156 | foreach (SceneObjectGroup g in x.objectGroups) | 156 | foreach (SceneObjectGroup g in x.objectGroups) |
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
162 | m_log.ErrorFormat( | 162 | m_log.ErrorFormat( |
163 | "[ASYNC DELETER]: Exception background sending object: {0}{1}", e.Message, e.StackTrace); | 163 | "[ASYNC DELETER]: Exception background sending object: {0}{1}", e.Message, e.StackTrace); |
164 | } | 164 | } |
165 | 165 | ||
166 | return true; | 166 | return true; |
167 | } | 167 | } |
168 | } | 168 | } |
@@ -173,14 +173,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
173 | // FIXME: This needs to be fixed. | 173 | // FIXME: This needs to be fixed. |
174 | m_log.ErrorFormat( | 174 | m_log.ErrorFormat( |
175 | "[ASYNC DELETER]: Queued sending of scene object to agent {0} {1} failed: {2} {3}", | 175 | "[ASYNC DELETER]: Queued sending of scene object to agent {0} {1} failed: {2} {3}", |
176 | (x != null ? x.remoteClient.Name : "unavailable"), | 176 | (x != null ? x.remoteClient.Name : "unavailable"), |
177 | (x != null ? x.remoteClient.AgentId.ToString() : "unavailable"), | 177 | (x != null ? x.remoteClient.AgentId.ToString() : "unavailable"), |
178 | e.Message, | 178 | e.Message, |
179 | e.StackTrace); | 179 | e.StackTrace); |
180 | } | 180 | } |
181 | 181 | ||
182 | // m_log.Debug("[ASYNC DELETER]: No objects left in inventory send queue."); | 182 | // m_log.Debug("[ASYNC DELETER]: No objects left in inventory send queue."); |
183 | 183 | ||
184 | return false; | 184 | return false; |
185 | } | 185 | } |
186 | } | 186 | } |