diff options
author | Justin Clarke Casey | 2009-02-17 18:19:24 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-17 18:19:24 +0000 |
commit | e28738c13b4eb3e1a3a2fc6e8edbc2584e50c0fb (patch) | |
tree | 2b19032e40d6a3ea4d2d9db9092e6bbc529b2241 | |
parent | * extend inventory archive save test to check for the presence of the item fi... (diff) | |
download | opensim-SC_OLD-e28738c13b4eb3e1a3a2fc6e8edbc2584e50c0fb.zip opensim-SC_OLD-e28738c13b4eb3e1a3a2fc6e8edbc2584e50c0fb.tar.gz opensim-SC_OLD-e28738c13b4eb3e1a3a2fc6e8edbc2584e50c0fb.tar.bz2 opensim-SC_OLD-e28738c13b4eb3e1a3a2fc6e8edbc2584e50c0fb.tar.xz |
* 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)
3 files changed, 6 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 6b57ac5..dfa4100 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -104,17 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
104 | reader.ReadStartElement("Owner"); | 104 | reader.ReadStartElement("Owner"); |
105 | item.Owner = UUID.Parse(reader.ReadString()); | 105 | item.Owner = UUID.Parse(reader.ReadString()); |
106 | reader.ReadEndElement(); | 106 | reader.ReadEndElement(); |
107 | //No description would kill it | 107 | reader.ReadElementString("Description"); |
108 | if (reader.IsEmptyElement) | ||
109 | { | ||
110 | reader.ReadStartElement("Description"); | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | reader.ReadStartElement("Description"); | ||
115 | item.Description = reader.ReadString(); | ||
116 | reader.ReadEndElement(); | ||
117 | } | ||
118 | reader.ReadStartElement("AssetType"); | 108 | reader.ReadStartElement("AssetType"); |
119 | item.AssetType = Convert.ToInt32(reader.ReadString()); | 109 | item.AssetType = Convert.ToInt32(reader.ReadString()); |
120 | reader.ReadEndElement(); | 110 | reader.ReadEndElement(); |
@@ -225,6 +215,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
225 | 215 | ||
226 | if (item != null) | 216 | if (item != null) |
227 | { | 217 | { |
218 | // Don't use the item ID that's in the file | ||
219 | item.ID = UUID.Random(); | ||
220 | |||
228 | item.Creator = m_userInfo.UserProfile.ID; | 221 | item.Creator = m_userInfo.UserProfile.ID; |
229 | item.Owner = m_userInfo.UserProfile.ID; | 222 | item.Owner = m_userInfo.UserProfile.ID; |
230 | 223 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 456831d..be700e9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -109,6 +109,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
109 | path, inventoryItem.Name, inventoryItem.ID); | 109 | path, inventoryItem.Name, inventoryItem.ID); |
110 | StringWriter sw = new StringWriter(); | 110 | StringWriter sw = new StringWriter(); |
111 | XmlTextWriter writer = new XmlTextWriter(sw); | 111 | XmlTextWriter writer = new XmlTextWriter(sw); |
112 | writer.Formatting = Formatting.Indented; | ||
113 | |||
112 | writer.WriteStartElement("InventoryObject"); | 114 | writer.WriteStartElement("InventoryObject"); |
113 | writer.WriteStartElement("Name"); | 115 | writer.WriteStartElement("Name"); |
114 | writer.WriteString(inventoryItem.Name); | 116 | writer.WriteString(inventoryItem.Name); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index c43f543..dafce81 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -113,8 +113,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
113 | 113 | ||
114 | MemoryStream archiveWriteStream = new MemoryStream(); | 114 | MemoryStream archiveWriteStream = new MemoryStream(); |
115 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; | 115 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; |
116 | |||
117 | archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream); | ||
118 | 116 | ||
119 | lock (this) | 117 | lock (this) |
120 | { | 118 | { |