Tell the user when a 'save iar' has failed because the inventory path could not be found

0.6.8-post-fixes
Justin Clark-Casey (justincc) 2009-11-09 16:42:17 +00:00
parent a3105a34ca
commit 678a74e4f7
1 changed files with 21 additions and 53 deletions

View File

@ -217,37 +217,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
InventoryItemBase inventoryItem = null;
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.UserProfile.ID);
// XXX: Very temporarily, drop and refetch inventory to make sure we have any newly created items in cache
// This will disappear very soon once we stop using the old cached inventory.
/*
m_userInfo.DropInventory();
m_userInfo.FetchInventory();
*/
/*
if (!m_userInfo.HasReceivedInventory)
{
// If the region server has access to the user admin service (by which users are created),
// then we'll assume that it's okay to fiddle with the user's inventory even if they are not on the
// server.
//
// FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might
// use a remote inventory service, though this is vanishingly rare at the moment.
if (null == m_scene.CommsManager.UserAdminService)
{
m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}",
m_userInfo.UserProfile.Name, m_userInfo.UserProfile.ID);
return;
}
else
{
m_userInfo.FetchInventory();
}
}
*/
bool foundStar = false;
// Eliminate double slashes and any leading / on the path.
@ -294,34 +263,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_archiveWriter = new TarArchiveWriter(m_saveStream);
if (null == inventoryFolder)
{
if (null == inventoryItem)
{
// We couldn't find the path indicated
m_saveStream.Close();
m_module.TriggerInventoryArchiveSaved(
m_id, false, m_userInfo, m_invPath, m_saveStream,
new Exception(string.Format("Could not find inventory entry at path {0}", m_invPath)));
return;
}
else
{
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found item {0} {1} at {2}",
inventoryItem.Name, inventoryItem.ID, m_invPath);
SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH);
}
}
else
if (inventoryFolder != null)
{
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
inventoryFolder.Name, inventoryFolder.ID, m_invPath);
//recurse through all dirs getting dirs and files
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar);
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar);
}
else if (inventoryItem != null)
{
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found item {0} {1} at {2}",
inventoryItem.Name, inventoryItem.ID, m_invPath);
SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH);
}
else
{
// We couldn't find the path indicated
m_saveStream.Close();
string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", errorMessage);
m_module.TriggerInventoryArchiveSaved(
m_id, false, m_userInfo, m_invPath, m_saveStream,
new Exception(errorMessage));
return;
}
// Don't put all this profile information into the archive right now.