Change existing IAR save to use UUID for its callback reference instead of Guid. This is for uniformity as discussed on IRC.
parent
3bde737f76
commit
08675d44a7
|
@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// <value>
|
||||
/// ID of this request
|
||||
/// </value>
|
||||
protected Guid m_id;
|
||||
protected UUID m_id;
|
||||
|
||||
/// <value>
|
||||
/// 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
|
|||
/// Constructor
|
||||
/// </summary>
|
||||
public InventoryArchiveWriteRequest(
|
||||
Guid id, InventoryArchiverModule module, Scene scene,
|
||||
UUID id, InventoryArchiverModule module, Scene scene,
|
||||
UserAccount userInfo, string invPath, string savePath)
|
||||
: this(
|
||||
id,
|
||||
|
@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// Constructor
|
||||
/// </summary>
|
||||
public InventoryArchiveWriteRequest(
|
||||
Guid id, InventoryArchiverModule module, Scene scene,
|
||||
UUID id, InventoryArchiverModule module, Scene scene,
|
||||
UserAccount userInfo, string invPath, Stream saveStream)
|
||||
{
|
||||
m_id = id;
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// <value>
|
||||
/// Pending save completions initiated from the console
|
||||
/// </value>
|
||||
protected List<Guid> m_pendingConsoleSaves = new List<Guid>();
|
||||
protected List<UUID> m_pendingConsoleSaves = new List<UUID>();
|
||||
|
||||
/// <value>
|
||||
/// All scenes that this module knows about
|
||||
|
@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// Trigger the inventory archive saved event.
|
||||
/// </summary>
|
||||
protected internal void TriggerInventoryArchiveSaved(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Exception reportedException)
|
||||
{
|
||||
InventoryArchiveSaved handlerInventoryArchiveSaved = OnInventoryArchiveSaved;
|
||||
|
@ -184,13 +184,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
}
|
||||
|
||||
public bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream)
|
||||
UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream)
|
||||
{
|
||||
return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary<string, object>());
|
||||
}
|
||||
|
||||
public bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
|
||||
UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
if (m_scenes.Count > 0)
|
||||
|
@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
}
|
||||
|
||||
public bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, string savePath,
|
||||
UUID id, string firstName, string lastName, string invPath, string pass, string savePath,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
// if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, savePath))
|
||||
|
@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// <param name="cmdparams"></param>
|
||||
protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
|
||||
{
|
||||
Guid id = Guid.NewGuid();
|
||||
UUID id = UUID.Random();
|
||||
|
||||
Dictionary<string, object> options = new Dictionary<string, object>();
|
||||
|
||||
|
@ -477,7 +477,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
}
|
||||
|
||||
private void SaveInvConsoleCommandCompleted(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Exception reportedException)
|
||||
{
|
||||
lock (m_pendingConsoleSaves)
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
|
||||
mre.Reset();
|
||||
archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream);
|
||||
UUID.Random(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream);
|
||||
mre.WaitOne(60000, false);
|
||||
|
||||
// LOAD ITEM
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
|
||||
mre.Reset();
|
||||
m_archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "/", userPassword, archiveWriteStream);
|
||||
UUID.Random(), userFirstName, userLastName, "/", userPassword, archiveWriteStream);
|
||||
mre.WaitOne(60000, false);
|
||||
|
||||
// Test created iar
|
||||
|
@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
|
||||
mre.Reset();
|
||||
m_archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "f1", userPassword, archiveWriteStream);
|
||||
UUID.Random(), userFirstName, userLastName, "f1", userPassword, archiveWriteStream);
|
||||
mre.WaitOne(60000, false);
|
||||
|
||||
// Test created iar
|
||||
|
@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
|
||||
mre.Reset();
|
||||
m_archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream);
|
||||
UUID.Random(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream);
|
||||
mre.WaitOne(60000, false);
|
||||
|
||||
byte[] archive = archiveWriteStream.ToArray();
|
||||
|
@ -364,7 +364,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
|
||||
// When we're not saving assets, archiving is being done synchronously.
|
||||
m_archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream, options);
|
||||
UUID.Random(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream, options);
|
||||
|
||||
byte[] archive = archiveWriteStream.ToArray();
|
||||
MemoryStream archiveReadStream = new MemoryStream(archive);
|
||||
|
|
|
@ -163,13 +163,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
|||
scene.AddInventoryItem(coaItem);
|
||||
|
||||
archiverModule.ArchiveInventory(
|
||||
Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream);
|
||||
UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream);
|
||||
|
||||
m_iarStreamBytes = archiveWriteStream.ToArray();
|
||||
}
|
||||
|
||||
protected void SaveCompleted(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
|
||||
Exception reportedException)
|
||||
{
|
||||
mre.Set();
|
||||
|
|
|
@ -29,6 +29,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
|
@ -42,7 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// <param name="savePath">The stream to which the archive was saved</param>
|
||||
/// <param name="reportedException">Contains the exception generated if the save did not succeed</param>
|
||||
public delegate void InventoryArchiveSaved(
|
||||
Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException);
|
||||
UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException);
|
||||
|
||||
public interface IInventoryArchiverModule
|
||||
{
|
||||
|
@ -84,7 +85,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// <param name="invPath">The inventory path from which the inventory should be saved.</param>
|
||||
/// <param name="saveStream">The stream to which the inventory archive will be saved</param>
|
||||
/// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
|
||||
bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream);
|
||||
bool ArchiveInventory(UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream);
|
||||
|
||||
/// <summary>
|
||||
/// Archive a user's inventory folder to the given stream
|
||||
|
@ -97,7 +98,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// <param name="options">Archiving options. Currently, there are none.</param>
|
||||
/// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
|
||||
bool ArchiveInventory(
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
|
||||
UUID id, string firstName, string lastName, string invPath, string pass, Stream saveStream,
|
||||
Dictionary<string, object> options);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue