* Assign incoming items with a random UUID so that archives can be loaded more than once

* Also remove a duplicate write archive call in the unit test which might be causing test failures for people using mono 2.2 (though not 1.9.1, it would seem)
0.6.3-post-fixes
Justin Clarke Casey 2009-02-17 18:19:24 +00:00
parent d205cb5260
commit e28738c13b
3 changed files with 6 additions and 13 deletions

View File

@ -104,17 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
reader.ReadStartElement("Owner");
item.Owner = UUID.Parse(reader.ReadString());
reader.ReadEndElement();
//No description would kill it
if (reader.IsEmptyElement)
{
reader.ReadStartElement("Description");
}
else
{
reader.ReadStartElement("Description");
item.Description = reader.ReadString();
reader.ReadEndElement();
}
reader.ReadElementString("Description");
reader.ReadStartElement("AssetType");
item.AssetType = Convert.ToInt32(reader.ReadString());
reader.ReadEndElement();
@ -225,6 +215,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (item != null)
{
// Don't use the item ID that's in the file
item.ID = UUID.Random();
item.Creator = m_userInfo.UserProfile.ID;
item.Owner = m_userInfo.UserProfile.ID;

View File

@ -109,6 +109,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
path, inventoryItem.Name, inventoryItem.ID);
StringWriter sw = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(sw);
writer.Formatting = Formatting.Indented;
writer.WriteStartElement("InventoryObject");
writer.WriteStartElement("Name");
writer.WriteString(inventoryItem.Name);

View File

@ -113,8 +113,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
MemoryStream archiveWriteStream = new MemoryStream();
archiverModule.OnInventoryArchiveSaved += SaveCompleted;
archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream);
lock (this)
{