From 3be340cbf2b03fe65ae9646f7b069edcb24d45fe Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 22 Nov 2015 05:42:13 +0000 Subject: a few changes on Multiregion control file load ; load oar seems far from good --- .../CoreModules/World/Archiver/ArchiveReadRequest.cs | 5 +---- .../CoreModules/World/Archiver/DearchiveScenesGroup.cs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 63dd4b2..994fe01 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -217,8 +217,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver 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); m_boundingOrigin = Vector3.Zero; m_boundingSize = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, float.MaxValue); @@ -239,7 +237,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver else m_log.InfoFormat("[ARCHIVER]: The bounding cube origin must be within the destination region! Setting to {0}.", m_boundingOrigin.ToString()); } - if (options.ContainsKey("bounding-size")) { Vector3 bsOption = (Vector3)options["bounding-size"]; @@ -1194,7 +1191,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } dearchivedScenes.MultiRegionFormat = multiRegion; - if (!multiRegion) + if (!multiRegion && dearchivedScenes.GetScenesCount() == 0) { // Add the single scene dearchivedScenes.StartRow(); diff --git a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs index 12a520f..87969c2 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs @@ -75,6 +75,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// The size of the region being loaded. /// public Vector3 RegionSize { get; set; } + + public RegionInfo() + { + RegionSize = new Vector3(256f,256f,float.MaxValue); + } } /// @@ -118,12 +123,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void StartRegion() { m_curX = (m_curX == null) ? 0 : m_curX + 1; - // Note: this doesn't mean we have a real region in this location; this could just be a "hole" + // Note: this doesn't mean we have a real region in this location; this could just be a "hole" } public void SetRegionOriginalID(string id) { - if (m_curRegion == null) m_curRegion = new RegionInfo(); + m_curRegion = new RegionInfo(); m_curRegion.Location = new Point((int)m_curX, (int)m_curY); m_curRegion.OriginalID = id; // 'curRegion' will be saved in 'm_directory2region' when SetRegionDir() is called @@ -137,7 +142,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void SetRegionSize(Vector3 size) { - if (m_curRegion == null) m_curRegion = new RegionInfo(); m_curRegion.RegionSize = size; } @@ -155,7 +159,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver { foreach (RegionInfo archivedRegion in m_directory2region.Values) { - Point location = new Point((int)rootScene.RegionInfo.RegionLocX, (int)rootScene.RegionInfo.RegionLocY); + Point location = new Point((int)rootScene.RegionInfo.RegionLocX, + (int)rootScene.RegionInfo.RegionLocY); + location.Offset(archivedRegion.Location); Scene scene; @@ -238,5 +244,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver return m_newId2region.Keys.ToList(); } + public int GetScenesCount() + { + return m_directory2region.Count; + } } } -- cgit v1.1