From 5a26dc2743f176cc5f5fad0ae93aa8187a399f13 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 27 Jan 2011 18:48:48 +0000 Subject: Fix OAR parcel loading so that old parcels are replaced by the new instead of merged. The --merge switch will still merge the old and new land parcelling. --- .../CoreModules/World/Archiver/ArchiveReadRequest.cs | 4 ++++ OpenSim/Region/CoreModules/World/Land/LandChannel.cs | 6 ++++++ .../CoreModules/World/Land/LandManagementModule.cs | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 3238a81..6a96d87 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -230,6 +230,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; landData.Add(parcel); } + + if (!m_merge) + m_scene.LandChannel.Clear(); + m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 9e27ef0..2959eb4 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -116,6 +116,12 @@ namespace OpenSim.Region.CoreModules.World.Land return new List(); } + + public void Clear() + { + if (m_landManagementModule != null) + m_landManagementModule.Clear(); + } public List ParcelsNearPoint(Vector3 position) { diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 4db28e2..bee223a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -636,6 +636,25 @@ namespace OpenSim.Region.CoreModules.World.Land m_landList.Remove(local_id); } } + + /// + /// Clear the scene of all parcels + /// + public void Clear() + { + lock (m_landList) + { + foreach (ILandObject lo in m_landList.Values) + { + //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); + m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); + } + + m_landList.Clear(); + } + + ResetSimLandObjects(); + } private void performFinalLandJoin(ILandObject master, ILandObject slave) { -- cgit v1.1