* Make save iar behave properly if the nominated inventory path does not exist
* load iar probably still fails for thisGenericGridServerConcept
parent
2d7c15c560
commit
5e4cad07eb
|
@ -95,6 +95,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_saveStream.Close();
|
||||
reportedException = e;
|
||||
succeeded = false;
|
||||
}
|
||||
|
@ -104,9 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
|
||||
protected void saveInvItem(InventoryItemBase inventoryItem, string path)
|
||||
{
|
||||
string filename
|
||||
= string.Format("{0}{1}_{2}.xml",
|
||||
path, inventoryItem.Name, inventoryItem.ID);
|
||||
string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID);
|
||||
StringWriter sw = new StringWriter();
|
||||
XmlTextWriter writer = new XmlTextWriter(sw);
|
||||
writer.Formatting = Formatting.Indented;
|
||||
|
@ -182,6 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
List<InventoryItemBase> items = inventoryFolder.RequestListOfItems();
|
||||
string newPath = path + inventoryFolder.Name + InventoryFolderImpl.PATH_DELIMITER;
|
||||
archive.AddDir(newPath);
|
||||
|
||||
foreach (InventoryFolderImpl folder in inventories)
|
||||
{
|
||||
saveInvDir(folder, newPath);
|
||||
|
@ -192,6 +192,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute the inventory write request
|
||||
/// </summary>
|
||||
public void Execute()
|
||||
{
|
||||
InventoryFolderImpl inventoryFolder = null;
|
||||
|
@ -251,7 +254,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
{
|
||||
if (null == inventoryItem)
|
||||
{
|
||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not find inventory entry at path {0}", m_invPath);
|
||||
m_saveStream.Close();
|
||||
m_module.TriggerInventoryArchiveSaved(
|
||||
false, m_userInfo, m_invPath, m_saveStream,
|
||||
new Exception(string.Format("Could not find inventory entry at path {0}", m_invPath)));
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -73,7 +73,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
if (m_scenes.Count == 0)
|
||||
{
|
||||
scene.RegisterModuleInterface<IInventoryArchiverModule>(this);
|
||||
CommsManager = scene.CommsManager;
|
||||
CommsManager = scene.CommsManager;
|
||||
OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted;
|
||||
|
||||
scene.AddCommand(
|
||||
this, "load iar",
|
||||
|
@ -207,11 +208,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
"[INVENTORY ARCHIVER]: Saving archive {0} from inventory path {1} for {2} {3}",
|
||||
savePath, invPath, firstName, lastName);
|
||||
|
||||
ArchiveInventory(firstName, lastName, invPath, savePath);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Saved archive {0} for {1} {2}",
|
||||
savePath, firstName, lastName);
|
||||
ArchiveInventory(firstName, lastName, invPath, savePath);
|
||||
}
|
||||
|
||||
private void SaveInvConsoleCommandCompleted(
|
||||
bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException)
|
||||
{
|
||||
if (succeeded)
|
||||
{
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Saved archive for {0}", userInfo.UserProfile.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY ARCHIVER]: Archive save for {0} failed - {1}",
|
||||
userInfo.UserProfile.Name, reportedException.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue