aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAliciaRaven2014-09-06 05:19:12 +0100
committerJustin Clark-Casey (justincc)2014-09-23 00:04:50 +0100
commit08675d44a754156ecdfd09d01ae1209bf73e2533 (patch)
treeb67c465a45e32b4055348b5c20aee0e721fc736b
parentInclude same content filters for IAR file exports that already exist for OAR ... (diff)
downloadopensim-SC_OLD-08675d44a754156ecdfd09d01ae1209bf73e2533.zip
opensim-SC_OLD-08675d44a754156ecdfd09d01ae1209bf73e2533.tar.gz
opensim-SC_OLD-08675d44a754156ecdfd09d01ae1209bf73e2533.tar.bz2
opensim-SC_OLD-08675d44a754156ecdfd09d01ae1209bf73e2533.tar.xz
Change existing IAR save to use UUID for its callback reference instead of Guid. This is for uniformity as discussed on IRC.
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs7
6 files changed, 21 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index ce81deb..0605db5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
80 /// <value> 80 /// <value>
81 /// ID of this request 81 /// ID of this request
82 /// </value> 82 /// </value>
83 protected Guid m_id; 83 protected UUID m_id;
84 84
85 /// <value> 85 /// <value>
86 /// Used to collect the uuids of the assets that we need to save into the archive 86 /// Used to collect the uuids of the assets that we need to save into the archive
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
101 /// Constructor 101 /// Constructor
102 /// </summary> 102 /// </summary>
103 public InventoryArchiveWriteRequest( 103 public InventoryArchiveWriteRequest(
104 Guid id, InventoryArchiverModule module, Scene scene, 104 UUID id, InventoryArchiverModule module, Scene scene,
105 UserAccount userInfo, string invPath, string savePath) 105 UserAccount userInfo, string invPath, string savePath)
106 : this( 106 : this(
107 id, 107 id,
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
117 /// Constructor 117 /// Constructor
118 /// </summary> 118 /// </summary>
119 public InventoryArchiveWriteRequest( 119 public InventoryArchiveWriteRequest(
120 Guid id, InventoryArchiverModule module, Scene scene, 120 UUID id, InventoryArchiverModule module, Scene scene,
121 UserAccount userInfo, string invPath, Stream saveStream) 121 UserAccount userInfo, string invPath, Stream saveStream)
122 { 122 {
123 m_id = id; 123 m_id = id;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index dc67738..0e4d79c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
66 /// <value> 66 /// <value>
67 /// Pending save completions initiated from the console 67 /// Pending save completions initiated from the console
68 /// </value> 68 /// </value>
69 protected List<Guid> m_pendingConsoleSaves = new List<Guid>(); 69 protected List<UUID> m_pendingConsoleSaves = new List<UUID>();
70 70
71 /// <value> 71 /// <value>
72 /// All scenes that this module knows about 72 /// All scenes that this module knows about
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
175 /// Trigger the inventory archive saved event. 175 /// Trigger the inventory archive saved event.
176 /// </summary> 176 /// </summary>
177 protected internal void TriggerInventoryArchiveSaved( 177 protected internal void TriggerInventoryArchiveSaved(
178 Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, 178 UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
179 Exception reportedException) 179 Exception reportedException)
180 { 180 {
181 InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved; 181 InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved;
@@ -184,13 +184,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
184 } 184 }
185 185
186 public bool ArchiveInventory( 186 public bool ArchiveInventory(
187 Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) 187 UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream)
188 { 188 {
189 return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary<string, object>()); 189 return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary<string, object>());
190 } 190 }
191 191
192 public bool ArchiveInventory( 192 public bool ArchiveInventory(
193 Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, 193 UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
194 Dictionary<string, object> options) 194 Dictionary<string, object> options)
195 { 195 {
196 if (m_scenes.Count > 0) 196 if (m_scenes.Count > 0)
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
230 } 230 }
231 231
232 public bool ArchiveInventory( 232 public bool ArchiveInventory(
233 Guid id, string firstName, string lastName, string invPath, string pass, string savePath, 233 UUID id, string firstName, string lastName, string invPath, string pass, string savePath,
234 Dictionary<string, object> options) 234 Dictionary<string, object> options)
235 { 235 {
236// if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, savePath)) 236// if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, savePath))
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
417 /// <param name="cmdparams"></param> 417 /// <param name="cmdparams"></param>
418 protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) 418 protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
419 { 419 {
420 Guid id = Guid.NewGuid(); 420 UUID id = UUID.Random();
421 421
422 Dictionary<string, object> options = new Dictionary<string, object>(); 422 Dictionary<string, object> options = new Dictionary<string, object>();
423 423
@@ -477,7 +477,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
477 } 477 }
478 478
479 private void SaveInvConsoleCommandCompleted( 479 private void SaveInvConsoleCommandCompleted(
480 Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, 480 UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
481 Exception reportedException) 481 Exception reportedException)
482 { 482 {
483 lock (m_pendingConsoleSaves) 483 lock (m_pendingConsoleSaves)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs
index 08f199a..dabece3 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
180 180
181 mre.Reset(); 181 mre.Reset();
182 archiverModule.ArchiveInventory( 182 archiverModule.ArchiveInventory(
183 Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); 183 UUID.Random(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream);
184 mre.WaitOne(60000, false); 184 mre.WaitOne(60000, false);
185 185
186 // LOAD ITEM 186 // LOAD ITEM
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs
index b85739e..254aa11 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
110 110
111 mre.Reset(); 111 mre.Reset();
112 m_archiverModule.ArchiveInventory( 112 m_archiverModule.ArchiveInventory(
113 Guid.NewGuid(), userFirstName, userLastName, "/", userPassword, archiveWriteStream); 113 UUID.Random(), userFirstName, userLastName, "/", userPassword, archiveWriteStream);
114 mre.WaitOne(60000, false); 114 mre.WaitOne(60000, false);
115 115
116 // Test created iar 116 // Test created iar
@@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
179 179
180 mre.Reset(); 180 mre.Reset();
181 m_archiverModule.ArchiveInventory( 181 m_archiverModule.ArchiveInventory(
182 Guid.NewGuid(), userFirstName, userLastName, "f1", userPassword, archiveWriteStream); 182 UUID.Random(), userFirstName, userLastName, "f1", userPassword, archiveWriteStream);
183 mre.WaitOne(60000, false); 183 mre.WaitOne(60000, false);
184 184
185 // Test created iar 185 // Test created iar
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
267 267
268 mre.Reset(); 268 mre.Reset();
269 m_archiverModule.ArchiveInventory( 269 m_archiverModule.ArchiveInventory(
270 Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream); 270 UUID.Random(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream);
271 mre.WaitOne(60000, false); 271 mre.WaitOne(60000, false);
272 272
273 byte[] archive = archiveWriteStream.ToArray(); 273 byte[] archive = archiveWriteStream.ToArray();
@@ -364,7 +364,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
364 364
365 // When we're not saving assets, archiving is being done synchronously. 365 // When we're not saving assets, archiving is being done synchronously.
366 m_archiverModule.ArchiveInventory( 366 m_archiverModule.ArchiveInventory(
367 Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream, options); 367 UUID.Random(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream, options);
368 368
369 byte[] archive = archiveWriteStream.ToArray(); 369 byte[] archive = archiveWriteStream.ToArray();
370 MemoryStream archiveReadStream = new MemoryStream(archive); 370 MemoryStream archiveReadStream = new MemoryStream(archive);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index db78da9..cc746d5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -163,13 +163,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
163 scene.AddInventoryItem(coaItem); 163 scene.AddInventoryItem(coaItem);
164 164
165 archiverModule.ArchiveInventory( 165 archiverModule.ArchiveInventory(
166 Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); 166 UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream);
167 167
168 m_iarStreamBytes = archiveWriteStream.ToArray(); 168 m_iarStreamBytes = archiveWriteStream.ToArray();
169 } 169 }
170 170
171 protected void SaveCompleted( 171 protected void SaveCompleted(
172 Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, 172 UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
173 Exception reportedException) 173 Exception reportedException)
174 { 174 {
175 mre.Set(); 175 mre.Set();
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
index ddf7565..54251a4 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenMetaverse;
32 33
33namespace OpenSim.Region.Framework.Interfaces 34namespace OpenSim.Region.Framework.Interfaces
34{ 35{
@@ -42,7 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces
42 /// <param name="savePath">The stream to which the archive was saved</param> 43 /// <param name="savePath">The stream to which the archive was saved</param>
43 /// <param name="reportedException">Contains the exception generated if the save did not succeed</param> 44 /// <param name="reportedException">Contains the exception generated if the save did not succeed</param>
44 public delegate void InventoryArchiveSaved( 45 public delegate void InventoryArchiveSaved(
45 Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException); 46 UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException);
46 47
47 public interface IInventoryArchiverModule 48 public interface IInventoryArchiverModule
48 { 49 {
@@ -84,7 +85,7 @@ namespace OpenSim.Region.Framework.Interfaces
84 /// <param name="invPath">The inventory path from which the inventory should be saved.</param> 85 /// <param name="invPath">The inventory path from which the inventory should be saved.</param>
85 /// <param name="saveStream">The stream to which the inventory archive will be saved</param> 86 /// <param name="saveStream">The stream to which the inventory archive will be saved</param>
86 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns> 87 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
87 bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream); 88 bool ArchiveInventory(UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream);
88 89
89 /// <summary> 90 /// <summary>
90 /// Archive a user's inventory folder to the given stream 91 /// Archive a user's inventory folder to the given stream
@@ -97,7 +98,7 @@ namespace OpenSim.Region.Framework.Interfaces
97 /// <param name="options">Archiving options. Currently, there are none.</param> 98 /// <param name="options">Archiving options. Currently, there are none.</param>
98 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns> 99 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
99 bool ArchiveInventory( 100 bool ArchiveInventory(
100 Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, 101 UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
101 Dictionary<string, object> options); 102 Dictionary<string, object> options);
102 } 103 }
103} 104}