From 3829df10595911de9ed1ce2f7b6cdd205828f8d0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 24 Aug 2015 17:05:16 +0100
Subject: try to implement core load oar options
---
.../World/Archiver/ArchiveReadRequest.cs | 289 ++++++++++++++-------
.../CoreModules/World/Archiver/ArchiverModule.cs | 118 ++++++++-
.../World/Archiver/Tests/ArchiverTests.cs | 17 +-
3 files changed, 314 insertions(+), 110 deletions(-)
(limited to 'OpenSim/Region/CoreModules/World/Archiver')
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index efc4998..5d41125 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -100,10 +100,37 @@ namespace OpenSim.Region.CoreModules.World.Archiver
protected bool m_merge;
///
+ /// If true, force the loading of terrain from the oar file
+ ///
+ protected bool m_forceTerrain;
+
+ ///
+ /// If true, force the loading of parcels from the oar file
+ ///
+ protected bool m_forceParcels;
+
+ ///
/// Should we ignore any assets when reloading the archive?
///
protected bool m_skipAssets;
+ ///
+ /// Displacement added to each object as it is added to the world
+ ///
+ protected Vector3 m_displacement = Vector3.Zero;
+
+ ///
+ /// Rotation (in radians) to apply to the objects as they are loaded.
+ ///
+ protected float m_rotation = 0f;
+
+ ///
+ /// Center around which to apply the rotation relative to the origional oar position
+ ///
+ protected Vector3 m_rotationCenter = new Vector3(Constants.RegionSize / 2f, Constants.RegionSize / 2f, 0f);
+
+ protected bool m_noObjects = false;
+
///
/// Used to cache lookups for valid uuids.
///
@@ -131,11 +158,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private IAssetService m_assetService = null;
+ private UUID m_defaultUser;
- public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId)
+ public ArchiveReadRequest(Scene scene, string loadPath, Guid requestId, Dictionary options)
{
m_rootScene = scene;
+ if (options.ContainsKey("default-user"))
+ {
+ m_defaultUser = (UUID)options["default-user"];
+ m_log.InfoFormat("Using User {0} as default user", m_defaultUser.ToString());
+ }
+ else
+ {
+ m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner;
+ }
+
m_loadPath = loadPath;
try
{
@@ -148,28 +186,42 @@ namespace OpenSim.Region.CoreModules.World.Archiver
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
}
-
+
m_errorMessage = String.Empty;
- m_merge = merge;
- m_skipAssets = skipAssets;
+
+ m_merge = options.ContainsKey("merge");
+ m_forceTerrain = options.ContainsKey("force-terrain");
+ m_forceParcels = options.ContainsKey("force-parcels");
+ m_noObjects = options.ContainsKey("no-objects");
+ m_skipAssets = options.ContainsKey("skipAssets");
m_requestId = requestId;
+ m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero;
+ m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f;
+ m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"]
+ : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f);
- // Zero can never be a valid user id
+ m_requestId = requestId;
+
+ // Zero can never be a valid user id (or group)
m_validUserUuids[UUID.Zero] = false;
+ m_validGroupUuids[UUID.Zero] = false;
+
m_groupsModule = m_rootScene.RequestModuleInterface();
m_assetService = m_rootScene.AssetService;
}
- public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId)
+ public ArchiveReadRequest(Scene scene, Stream loadStream, Guid requestId, Dictionary options)
{
m_rootScene = scene;
m_loadPath = null;
m_loadStream = loadStream;
- m_merge = merge;
- m_skipAssets = skipAssets;
+ m_skipAssets = options.ContainsKey("skipAssets");
+ m_merge = options.ContainsKey("merge");
m_requestId = requestId;
+ m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner;
+
// Zero can never be a valid user id
m_validUserUuids[UUID.Zero] = false;
@@ -229,7 +281,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Process the file
- if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
+ if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH) && !m_noObjects)
{
sceneContext.SerialisedSceneObjects.Add(Encoding.UTF8.GetString(data));
}
@@ -243,15 +295,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if ((successfulAssetRestores + failedAssetRestores) % 250 == 0)
m_log.Debug("[ARCHIVER]: Loaded " + successfulAssetRestores + " assets and failed to load " + failedAssetRestores + " assets...");
}
- else if (!m_merge && filePath.StartsWith(ArchiveConstants.TERRAINS_PATH))
+ else if ((!m_merge || m_forceTerrain) && filePath.StartsWith(ArchiveConstants.TERRAINS_PATH))
{
LoadTerrain(scene, filePath, data);
}
else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH))
{
LoadRegionSettings(scene, filePath, data, dearchivedScenes);
- }
- else if (!m_merge && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH))
+ }
+ else if ((!m_merge || m_forceParcels) && filePath.StartsWith(ArchiveConstants.LANDDATA_PATH))
{
sceneContext.SerialisedParcels.Add(Encoding.UTF8.GetString(data));
}
@@ -422,6 +474,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Reload serialized prims
m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
+ OpenMetaverse.Quaternion rot = OpenMetaverse.Quaternion.CreateFromAxisAngle(0, 0, 1, m_rotation);
+
UUID oldTelehubUUID = scene.RegionInfo.RegionSettings.TelehubObject;
IRegionSerialiserModule serialiser = scene.RequestModuleInterface();
@@ -445,6 +499,31 @@ namespace OpenSim.Region.CoreModules.World.Archiver
SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject);
+ // Happily this does not do much to the object since it hasn't been added to the scene yet
+ if (!sceneObject.IsAttachment)
+ {
+ if (m_displacement != Vector3.Zero || m_rotation != 0f)
+ {
+ Vector3 pos = sceneObject.AbsolutePosition;
+ if (m_rotation != 0f)
+ {
+ // Rotate the object
+ sceneObject.RootPart.RotationOffset = rot * sceneObject.GroupRotation;
+ // Get object position relative to rotation axis
+ Vector3 offset = pos - m_rotationCenter;
+ // Rotate the object position
+ offset *= rot;
+ // Restore the object position back to relative to the region
+ pos = m_rotationCenter + offset;
+ }
+ if (m_displacement != Vector3.Zero)
+ {
+ pos += m_displacement;
+ }
+ sceneObject.AbsolutePosition = pos;
+ }
+ }
+
bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero);
// For now, give all incoming scene objects new uuids. This will allow scenes to be cloned
@@ -460,76 +539,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
oldTelehubUUID = UUID.Zero;
}
- // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
- // or creator data is present. Otherwise, use the estate owner instead.
- foreach (SceneObjectPart part in sceneObject.Parts)
- {
- if (string.IsNullOrEmpty(part.CreatorData))
- {
- if (!ResolveUserUuid(scene, part.CreatorID))
- part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
- }
- if (UserManager != null)
- UserManager.AddUser(part.CreatorID, part.CreatorData);
-
- if (!ResolveUserUuid(scene, part.OwnerID))
- part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
+ ModifySceneObject(scene, sceneObject);
- if (!ResolveUserUuid(scene, part.LastOwnerID))
- part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
-
- if (!ResolveGroupUuid(part.GroupID))
- part.GroupID = UUID.Zero;
-
- // And zap any troublesome sit target information
-// part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
-// part.SitTargetPosition = new Vector3(0, 0, 0);
-
- // Fix ownership/creator of inventory items
- // Not doing so results in inventory items
- // being no copy/no mod for everyone
- lock (part.TaskInventory)
- {
- if (!ResolveUserUuid(scene, part.CreatorID))
- part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
-
- if (!ResolveUserUuid(scene, part.OwnerID))
- part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
-
- if (!ResolveUserUuid(scene, part.LastOwnerID))
- part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
-
- // And zap any troublesome sit target information
- part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
- part.SitTargetPosition = new Vector3(0, 0, 0);
-
- // Fix ownership/creator of inventory items
- // Not doing so results in inventory items
- // being no copy/no mod for everyone
- part.TaskInventory.LockItemsForRead(true);
- TaskInventoryDictionary inv = part.TaskInventory;
- foreach (KeyValuePair kvp in inv)
- {
- if (!ResolveUserUuid(scene, kvp.Value.OwnerID))
- {
- kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
- }
-
- if (string.IsNullOrEmpty(kvp.Value.CreatorData))
- {
- if (!ResolveUserUuid(scene, kvp.Value.CreatorID))
- kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
- }
-
- if (UserManager != null)
- UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
-
- if (!ResolveGroupUuid(kvp.Value.GroupID))
- kvp.Value.GroupID = UUID.Zero;
- }
- part.TaskInventory.LockItemsForRead(false);
- }
- }
if (scene.AddRestoredSceneObject(sceneObject, true, false))
{
@@ -553,7 +564,76 @@ namespace OpenSim.Region.CoreModules.World.Archiver
scene.RegionInfo.RegionSettings.ClearSpawnPoints();
}
}
-
+
+ ///
+ /// Optionally modify a loaded SceneObjectGroup. Currently this just ensures that the
+ /// User IDs and Group IDs are valid, but other manipulations could be done as well.
+ ///
+ private void ModifySceneObject(Scene scene, SceneObjectGroup sceneObject)
+ {
+ // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
+ // or creator data is present. Otherwise, use the estate owner instead.
+ foreach (SceneObjectPart part in sceneObject.Parts)
+ {
+ if (string.IsNullOrEmpty(part.CreatorData))
+ {
+ if (!ResolveUserUuid(scene, part.CreatorID))
+ part.CreatorID = m_defaultUser;
+ }
+ if (UserManager != null)
+ UserManager.AddUser(part.CreatorID, part.CreatorData);
+
+ if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID)))
+ part.OwnerID = m_defaultUser;
+
+ if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID)))
+ part.LastOwnerID = m_defaultUser;
+
+ if (!ResolveGroupUuid(part.GroupID))
+ part.GroupID = UUID.Zero;
+
+ // And zap any troublesome sit target information
+ // part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
+ // part.SitTargetPosition = new Vector3(0, 0, 0);
+
+ // Fix ownership/creator of inventory items
+ // Not doing so results in inventory items
+ // being no copy/no mod for everyone
+ lock (part.TaskInventory)
+ {
+ // And zap any troublesome sit target information
+ part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
+ part.SitTargetPosition = new Vector3(0, 0, 0);
+
+ // Fix ownership/creator of inventory items
+ // Not doing so results in inventory items
+ // being no copy/no mod for everyone
+ part.TaskInventory.LockItemsForRead(true);
+ TaskInventoryDictionary inv = part.TaskInventory;
+ foreach (KeyValuePair kvp in inv)
+ {
+ if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID)))
+ {
+ kvp.Value.OwnerID = m_defaultUser;
+ }
+
+ if (string.IsNullOrEmpty(kvp.Value.CreatorData))
+ {
+ if (!ResolveUserUuid(scene, kvp.Value.CreatorID))
+ kvp.Value.CreatorID = m_defaultUser;
+ }
+
+ if (UserManager != null)
+ UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
+
+ if (!ResolveGroupUuid(kvp.Value.GroupID))
+ kvp.Value.GroupID = UUID.Zero;
+ }
+ part.TaskInventory.LockItemsForRead(false);
+ }
+ }
+ }
+
///
/// Load serialized parcels.
///
@@ -567,14 +647,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver
foreach (string serialisedParcel in serialisedParcels)
{
LandData parcel = LandDataSerializer.Deserialize(serialisedParcel);
-
+
+ if (m_displacement != Vector3.Zero)
+ {
+ Vector3 parcelDisp = new Vector3(m_displacement.X, m_displacement.Y, 0f);
+ parcel.AABBMin += parcelDisp;
+ parcel.AABBMax += parcelDisp;
+ }
+
// Validate User and Group UUID's
if (parcel.IsGroupOwned)
{
if (!ResolveGroupUuid(parcel.GroupID))
{
- parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
+ parcel.OwnerID = m_defaultUser;
parcel.GroupID = UUID.Zero;
parcel.IsGroupOwned = false;
}
@@ -582,7 +669,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
else
{
if (!ResolveUserUuid(scene, parcel.OwnerID))
- parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
+ parcel.OwnerID = m_defaultUser;
if (!ResolveGroupUuid(parcel.GroupID))
parcel.GroupID = UUID.Zero;
@@ -702,8 +789,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
if (assetType == (sbyte)AssetType.Unknown)
+ {
m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid);
-
+ }
+ else if (assetType == (sbyte)AssetType.Object)
+ {
+ data = SceneObjectSerializer.ModifySerializedObject(UUID.Parse(uuid), data,
+ sog =>
+ {
+ ModifySceneObject(m_rootScene, sog);
+ return true;
+ });
+
+ if (data == null)
+ return false;
+ }
//m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero.ToString());
@@ -825,10 +925,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private bool LoadTerrain(Scene scene, string terrainPath, byte[] data)
{
ITerrainModule terrainModule = scene.RequestModuleInterface();
-
- MemoryStream ms = new MemoryStream(data);
- terrainModule.LoadFromStream(terrainPath, ms);
- ms.Close();
+
+ using (MemoryStream ms = new MemoryStream(data))
+ {
+ if (m_displacement != Vector3.Zero || m_rotation != 0f)
+ {
+ Vector2 rotationCenter = new Vector2(m_rotationCenter.X, m_rotationCenter.Y);
+ terrainModule.LoadFromStream(terrainPath, m_displacement, m_rotation, rotationCenter, ms);
+ }
+ else
+ {
+ terrainModule.LoadFromStream(terrainPath, ms);
+ }
+ }
m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath);
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 1be6386..8a8e392 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -38,6 +38,8 @@ using OpenSim.Framework.Console;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
+using OpenMetaverse;
+
namespace OpenSim.Region.CoreModules.World.Archiver
{
///
@@ -101,9 +103,64 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
bool mergeOar = false;
bool skipAssets = false;
-
- OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; });
- options.Add("s|skip-assets", delegate (string v) { skipAssets = v != null; });
+ bool forceTerrain = false;
+ bool forceParcels = false;
+ bool noObjects = false;
+ Vector3 displacement = new Vector3(0f, 0f, 0f);
+ String defaultUser = "";
+ float rotation = 0f;
+ Vector3 rotationCenter = new Vector3(Constants.RegionSize / 2f, Constants.RegionSize / 2f, 0);
+
+ OptionSet options = new OptionSet();
+ options.Add("m|merge", delegate(string v) { mergeOar = (v != null); });
+ options.Add("s|skip-assets", delegate(string v) { skipAssets = (v != null); });
+ options.Add("force-terrain", delegate(string v) { forceTerrain = (v != null); });
+ options.Add("forceterrain", delegate(string v) { forceTerrain = (v != null); }); // downward compatibility
+ options.Add("force-parcels", delegate(string v) { forceParcels = (v != null); });
+ options.Add("forceparcels", delegate(string v) { forceParcels = (v != null); }); // downward compatibility
+ options.Add("no-objects", delegate(string v) { noObjects = (v != null); });
+ options.Add("default-user=", delegate(string v) { defaultUser = (v == null) ? "" : v; });
+ options.Add("displacement=", delegate(string v)
+ {
+ try
+ {
+ displacement = v == null ? Vector3.Zero : Vector3.Parse(v);
+ }
+ catch
+ {
+ m_log.ErrorFormat("[ARCHIVER MODULE] failure parsing displacement");
+ m_log.ErrorFormat("[ARCHIVER MODULE] Must be represented as vector3: --displacement \"<128,128,0>\"");
+ return;
+ }
+ });
+ options.Add("rotation=", delegate(string v)
+ {
+ try
+ {
+ rotation = v == null ? 0f : float.Parse(v);
+ }
+ catch
+ {
+ m_log.ErrorFormat("[ARCHIVER MODULE] failure parsing rotation");
+ m_log.ErrorFormat("[ARCHIVER MODULE] Must be an angle in degrees between -360 and +360: --rotation 45");
+ return;
+ }
+ // Convert to radians for internals
+ rotation = Util.Clamp(rotation, -359f, 359f) / 180f * (float)Math.PI;
+ });
+ options.Add("rotation-center=", delegate(string v)
+ {
+ try
+ {
+ rotationCenter = v == null ? Vector3.Zero : Vector3.Parse(v);
+ }
+ catch
+ {
+ m_log.ErrorFormat("[ARCHIVER MODULE] failure parsing rotation displacement");
+ m_log.ErrorFormat("[ARCHIVER MODULE] Must be represented as vector3: --rotation-center \"<128,128,0>\"");
+ return;
+ }
+ });
// Send a message to the region ready module
/* bluewall* Disable this for the time being
@@ -122,13 +179,44 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// foreach (string param in mainParams)
// m_log.DebugFormat("GOT PARAM [{0}]", param);
+ Dictionary archiveOptions = new Dictionary();
+ if (mergeOar) archiveOptions.Add("merge", null);
+ if (skipAssets) archiveOptions.Add("skipAssets", null);
+ if (forceTerrain) archiveOptions.Add("force-terrain", null);
+ if (forceParcels) archiveOptions.Add("force-parcels", null);
+ if (noObjects) archiveOptions.Add("no-objects", null);
+ if (defaultUser != "")
+ {
+ UUID defaultUserUUID = UUID.Zero;
+ try
+ {
+ defaultUserUUID = Scene.UserManagementModule.GetUserIdByName(defaultUser);
+ }
+ catch
+ {
+ m_log.ErrorFormat("[ARCHIVER MODULE] default user must be in format \"First Last\"", defaultUser);
+ }
+ if (defaultUserUUID == UUID.Zero)
+ {
+ m_log.ErrorFormat("[ARCHIVER MODULE] cannot find specified default user {0}", defaultUser);
+ return;
+ }
+ else
+ {
+ archiveOptions.Add("default-user", defaultUserUUID);
+ }
+ }
+ archiveOptions.Add("displacement", displacement);
+ archiveOptions.Add("rotation", rotation);
+ archiveOptions.Add("rotation-center", rotationCenter);
+
if (mainParams.Count > 2)
{
- DearchiveRegion(mainParams[2], mergeOar, skipAssets, Guid.Empty);
+ DearchiveRegion(mainParams[2], Guid.Empty, archiveOptions);
}
else
{
- DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, skipAssets, Guid.Empty);
+ DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, Guid.Empty, archiveOptions);
}
}
@@ -198,25 +286,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver
public void DearchiveRegion(string loadPath)
{
- DearchiveRegion(loadPath, false, false, Guid.Empty);
+ Dictionary archiveOptions = new Dictionary();
+ DearchiveRegion(loadPath, Guid.Empty, archiveOptions);
}
-
- public void DearchiveRegion(string loadPath, bool merge, bool skipAssets, Guid requestId)
+
+ public void DearchiveRegion(string loadPath, Guid requestId, Dictionary options)
{
m_log.InfoFormat(
"[ARCHIVER]: Loading archive to region {0} from {1}", Scene.RegionInfo.RegionName, loadPath);
-
- new ArchiveReadRequest(Scene, loadPath, merge, skipAssets, requestId).DearchiveRegion();
+
+ new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion();
}
public void DearchiveRegion(Stream loadStream)
{
- DearchiveRegion(loadStream, false, false, Guid.Empty);
+ Dictionary archiveOptions = new Dictionary();
+ DearchiveRegion(loadStream, Guid.Empty, archiveOptions);
}
-
- public void DearchiveRegion(Stream loadStream, bool merge, bool skipAssets, Guid requestId)
+
+ public void DearchiveRegion(Stream loadStream, Guid requestId, Dictionary options)
{
- new ArchiveReadRequest(Scene, loadStream, merge, skipAssets, requestId).DearchiveRegion();
+ new ArchiveReadRequest(Scene, loadStream, requestId, options).DearchiveRegion();
}
}
}
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index eec1cec..53f41f9 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -224,8 +224,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
-
- ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, false, false, Guid.Empty);
+
+ Dictionary archiveOptions = new Dictionary();
+ ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions);
arr.LoadControlFile(filePath, data, new DearchiveScenesInfo());
Assert.That(arr.ControlFileLoaded, Is.True);
@@ -308,8 +309,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
-
- ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, false, false, Guid.Empty);
+
+ Dictionary archiveOptions = new Dictionary();
+ ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions);
arr.LoadControlFile(filePath, data, new DearchiveScenesInfo());
Assert.That(arr.ControlFileLoaded, Is.True);
@@ -752,7 +754,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
byte[] archive = archiveWriteStream.ToArray();
MemoryStream archiveReadStream = new MemoryStream(archive);
- m_archiverModule.DearchiveRegion(archiveReadStream, true, false, Guid.Empty);
+ Dictionary archiveOptions = new Dictionary();
+ archiveOptions.Add("merge", null);
+ m_archiverModule.DearchiveRegion(archiveReadStream, Guid.Empty, archiveOptions);
SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name);
Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge");
@@ -860,7 +864,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
- ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, false, false, Guid.Empty);
+ Dictionary archiveOptions = new Dictionary();
+ ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions);
arr.LoadControlFile(filePath, data, new DearchiveScenesInfo());
Assert.That(arr.ControlFileLoaded, Is.True);
--
cgit v1.1