diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 74 |
1 files changed, 21 insertions, 53 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index af0b72f..6c37198 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -217,37 +217,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
217 | InventoryItemBase inventoryItem = null; | 217 | InventoryItemBase inventoryItem = null; |
218 | InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.UserProfile.ID); | 218 | InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.UserProfile.ID); |
219 | 219 | ||
220 | // XXX: Very temporarily, drop and refetch inventory to make sure we have any newly created items in cache | ||
221 | // This will disappear very soon once we stop using the old cached inventory. | ||
222 | /* | ||
223 | m_userInfo.DropInventory(); | ||
224 | m_userInfo.FetchInventory(); | ||
225 | */ | ||
226 | |||
227 | /* | ||
228 | if (!m_userInfo.HasReceivedInventory) | ||
229 | { | ||
230 | // If the region server has access to the user admin service (by which users are created), | ||
231 | // then we'll assume that it's okay to fiddle with the user's inventory even if they are not on the | ||
232 | // server. | ||
233 | // | ||
234 | // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might | ||
235 | // use a remote inventory service, though this is vanishingly rare at the moment. | ||
236 | if (null == m_scene.CommsManager.UserAdminService) | ||
237 | { | ||
238 | m_log.ErrorFormat( | ||
239 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", | ||
240 | m_userInfo.UserProfile.Name, m_userInfo.UserProfile.ID); | ||
241 | |||
242 | return; | ||
243 | } | ||
244 | else | ||
245 | { | ||
246 | m_userInfo.FetchInventory(); | ||
247 | } | ||
248 | } | ||
249 | */ | ||
250 | |||
251 | bool foundStar = false; | 220 | bool foundStar = false; |
252 | 221 | ||
253 | // Eliminate double slashes and any leading / on the path. | 222 | // Eliminate double slashes and any leading / on the path. |
@@ -294,34 +263,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
294 | 263 | ||
295 | m_archiveWriter = new TarArchiveWriter(m_saveStream); | 264 | m_archiveWriter = new TarArchiveWriter(m_saveStream); |
296 | 265 | ||
297 | if (null == inventoryFolder) | 266 | if (inventoryFolder != null) |
298 | { | ||
299 | if (null == inventoryItem) | ||
300 | { | ||
301 | // We couldn't find the path indicated | ||
302 | m_saveStream.Close(); | ||
303 | m_module.TriggerInventoryArchiveSaved( | ||
304 | m_id, false, m_userInfo, m_invPath, m_saveStream, | ||
305 | new Exception(string.Format("Could not find inventory entry at path {0}", m_invPath))); | ||
306 | return; | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | m_log.DebugFormat( | ||
311 | "[INVENTORY ARCHIVER]: Found item {0} {1} at {2}", | ||
312 | inventoryItem.Name, inventoryItem.ID, m_invPath); | ||
313 | |||
314 | SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH); | ||
315 | } | ||
316 | } | ||
317 | else | ||
318 | { | 267 | { |
319 | m_log.DebugFormat( | 268 | m_log.DebugFormat( |
320 | "[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}", | 269 | "[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}", |
321 | inventoryFolder.Name, inventoryFolder.ID, m_invPath); | 270 | inventoryFolder.Name, inventoryFolder.ID, m_invPath); |
322 | 271 | ||
323 | //recurse through all dirs getting dirs and files | 272 | //recurse through all dirs getting dirs and files |
324 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); | 273 | SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); |
274 | } | ||
275 | else if (inventoryItem != null) | ||
276 | { | ||
277 | m_log.DebugFormat( | ||
278 | "[INVENTORY ARCHIVER]: Found item {0} {1} at {2}", | ||
279 | inventoryItem.Name, inventoryItem.ID, m_invPath); | ||
280 | |||
281 | SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH); | ||
282 | } | ||
283 | else | ||
284 | { | ||
285 | // We couldn't find the path indicated | ||
286 | m_saveStream.Close(); | ||
287 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); | ||
288 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", errorMessage); | ||
289 | m_module.TriggerInventoryArchiveSaved( | ||
290 | m_id, false, m_userInfo, m_invPath, m_saveStream, | ||
291 | new Exception(errorMessage)); | ||
292 | return; | ||
325 | } | 293 | } |
326 | 294 | ||
327 | // Don't put all this profile information into the archive right now. | 295 | // Don't put all this profile information into the archive right now. |