Tell the user when a 'save iar' has failed because the inventory path could not be found
parent
a3105a34ca
commit
678a74e4f7
|
@ -217,37 +217,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
InventoryItemBase inventoryItem = null;
|
InventoryItemBase inventoryItem = null;
|
||||||
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.UserProfile.ID);
|
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;
|
bool foundStar = false;
|
||||||
|
|
||||||
// Eliminate double slashes and any leading / on the path.
|
// Eliminate double slashes and any leading / on the path.
|
||||||
|
@ -294,27 +263,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
|
|
||||||
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
||||||
|
|
||||||
if (null == inventoryFolder)
|
if (inventoryFolder != null)
|
||||||
{
|
|
||||||
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
|
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
|
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
|
||||||
|
@ -323,6 +272,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
//recurse through all dirs getting dirs and files
|
//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.
|
// Don't put all this profile information into the archive right now.
|
||||||
//SaveUsers();
|
//SaveUsers();
|
||||||
|
|
Loading…
Reference in New Issue