aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs48
1 files changed, 41 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index f002ad7..ad46107 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -218,10 +218,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
218 218
219 // Count inventory items (different to asset count) 219 // Count inventory items (different to asset count)
220 CountItems++; 220 CountItems++;
221 221
222 // Don't chase down link asset items as they actually point to their target item IDs rather than an asset 222 // Don't chase down link asset items as they actually point to their target item IDs rather than an asset
223 if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) 223 if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder)
224 {
225 int curErrorCntr = m_assetGatherer.ErrorCount;
226 int possible = m_assetGatherer.possibleNotAssetCount;
224 m_assetGatherer.AddForInspection(inventoryItem.AssetID); 227 m_assetGatherer.AddForInspection(inventoryItem.AssetID);
228 m_assetGatherer.GatherAll();
229 curErrorCntr = m_assetGatherer.ErrorCount - curErrorCntr;
230 possible = m_assetGatherer.possibleNotAssetCount - possible;
231
232 if(curErrorCntr > 0 || possible > 0)
233 {
234 string spath;
235 int indx = path.IndexOf("__");
236 if(indx > 0)
237 spath = path.Substring(0,indx);
238 else
239 spath = path;
240
241 if(curErrorCntr > 0)
242 {
243 m_log.ErrorFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references to missing or damaged assets",
244 inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, curErrorCntr);
245 if(possible > 0)
246 m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item also contains {0} references that may be to missing or damaged assets or not a problem", possible);
247 }
248 else if(possible > 0)
249 {
250 m_log.WarnFormat("[INVENTORY ARCHIVER Warning]: item {0} '{1}', type {2}, in '{3}', contains {4} references that may be to missing or damaged assets or not a problem", inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, possible);
251 }
252 }
253 }
225 } 254 }
226 255
227 /// <summary> 256 /// <summary>
@@ -381,6 +410,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
381 string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); 410 string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
382 Exception e = new InventoryArchiverException(errorMessage); 411 Exception e = new InventoryArchiverException(errorMessage);
383 m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e, 0, 0); 412 m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e, 0, 0);
413 if(m_saveStream != null && m_saveStream.CanWrite)
414 m_saveStream.Close();
384 throw e; 415 throw e;
385 } 416 }
386 417
@@ -420,17 +451,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
420 { 451 {
421 m_assetGatherer.GatherAll(); 452 m_assetGatherer.GatherAll();
422 453
454 int errors = m_assetGatherer.FailedUUIDs.Count;
455
423 m_log.DebugFormat( 456 m_log.DebugFormat(
424 "[INVENTORY ARCHIVER]: Saving {0} assets for items", m_assetGatherer.GatheredUuids.Count); 457 "[INVENTORY ARCHIVER]: The items to save reference {0} possible assets", m_assetGatherer.GatheredUuids.Count + errors);
458 if(errors > 0)
459 m_log.DebugFormat("[INVENTORY ARCHIVER]: {0} of these have problems or are not assets and will be ignored", errors);
425 460
426 AssetsRequest ar 461 AssetsRequest ar = new AssetsRequest(
427 = new AssetsRequest(
428 new AssetsArchiver(m_archiveWriter), 462 new AssetsArchiver(m_archiveWriter),
429 m_assetGatherer.GatheredUuids, m_scene.AssetService, 463 m_assetGatherer.GatheredUuids, m_assetGatherer.FailedUUIDs.Count,
464 m_scene.AssetService,
430 m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, 465 m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
431 options, ReceivedAllAssets); 466 options, ReceivedAllAssets);
432 467 ar.Execute();
433 WorkManager.RunInThread(o => ar.Execute(), null, string.Format("AssetsRequest ({0})", m_scene.Name));
434 } 468 }
435 else 469 else
436 { 470 {