From 8d5f32af18bdc6cd6fe5a78ab74943701a6374c3 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 14 Jan 2021 22:04:11 +0100 Subject: [PATCH] OAR keep UUID --- .../World/Archiver/ArchiveReadRequest.cs | 22 ++++++++++++++++++- .../World/Archiver/ArchiverModule.cs | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 68231a91b6..3bd5695b43 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -103,6 +103,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver protected bool m_merge; protected bool m_mergeReplaceObjects; + /// + /// Should the archive being loaded be persisting uuids? + /// + protected bool m_persistuuids = false; + /// /// If true, force the loading of terrain from the oar file /// @@ -220,6 +225,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_displacement = options.ContainsKey("displacement") ? (Vector3)options["displacement"] : Vector3.Zero; m_rotation = options.ContainsKey("rotation") ? (float)options["rotation"] : 0f; + m_persistuuids = options.ContainsKey("persist-uuids"); + if (m_persistuuids) + { + m_merge = false; + } + m_boundingOrigin = Vector3.Zero; m_boundingOrigin.Z = Constants.MinSimulationHeight; m_boundingSize = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, Constants.MaxSimulationHeight - Constants.MinSimulationHeight); @@ -276,6 +287,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_mergeReplaceObjects = options.ContainsKey("mReplaceObjects"); m_requestId = requestId; + m_persistuuids = options.ContainsKey("persist-uuids"); + if (m_persistuuids) + { + m_merge = false; + } + m_defaultUser = scene.RegionInfo.EstateSettings.EstateOwner; // Zero can never be a valid user id @@ -623,7 +640,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned // on the same region server and multiple examples a single object archive to be imported // to the same scene (when this is possible). - sceneObject.ResetIDs(); + if (!m_persistuuids) + { + sceneObject.ResetIDs(); + } if (isTelehub) { diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 329b0835a1..056dd27a82 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -106,6 +106,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver bool mergeTerrain = false; bool mergeParcels = false; bool noObjects = false; + bool persistUuids = false; Vector3 displacement = new Vector3(0f, 0f, 0f); String defaultUser = ""; float rotation = 0f; @@ -116,6 +117,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver OptionSet options = new OptionSet(); options.Add("m|merge", delegate(string v) { mergeOar = (v != null); }); + options.Add("persist-uuids", delegate (string v) { persistUuids = (v != null); }); options.Add("mergeReplaceObjects", delegate (string v) { mergeReplaceObjects = (v != null); }); options.Add("s|skip-assets", delegate(string v) { skipAssets = (v != null); }); options.Add("merge-terrain", delegate(string v) { mergeTerrain = (v != null); }); @@ -220,6 +222,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (mergeTerrain) archiveOptions.Add("merge-terrain", null); if (mergeParcels) archiveOptions.Add("merge-parcels", null); if (noObjects) archiveOptions.Add("no-objects", null); + if (persistUuids) archiveOptions.Add("persist-uuids", null); if (defaultUser != "") { UUID defaultUserUUID = UUID.Zero; -- 2.29.2.windows.3