diff options
author | Justin Clark-Casey (justincc) | 2011-01-27 20:29:06 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-01-27 20:36:50 +0000 |
commit | be3685b1a2ef8ebab25739fc5a5d632ed7359728 (patch) | |
tree | aeb319707ad5cffedf9f9756e74e8833c3d30eb4 /OpenSim | |
parent | Show local IDs in "land show" output. (diff) | |
download | opensim-SC_OLD-be3685b1a2ef8ebab25739fc5a5d632ed7359728.zip opensim-SC_OLD-be3685b1a2ef8ebab25739fc5a5d632ed7359728.tar.gz opensim-SC_OLD-be3685b1a2ef8ebab25739fc5a5d632ed7359728.tar.bz2 opensim-SC_OLD-be3685b1a2ef8ebab25739fc5a5d632ed7359728.tar.xz |
When an oar is loaded, do not create a default parcel before loading the parcels from the OAR.
The region spanning parcel shouldn't exist in this situation. If it does, when the land data is loaded it is repersisted with a local ID which comes after the ones loaded via the oar, which obliterates the oar loaded one.
Resaving the data we just loaded from the database is somewhat odd in itself (though this makes sense from the way that OAR loading was already using the same event).
Diffstat (limited to 'OpenSim')
6 files changed, 25 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 2d2772b..44fd994 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
237 | } | 237 | } |
238 | 238 | ||
239 | if (!m_merge) | 239 | if (!m_merge) |
240 | m_scene.LandChannel.Clear(); | 240 | m_scene.LandChannel.Clear(false); |
241 | 241 | ||
242 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | 242 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); |
243 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | 243 | 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 2959eb4..7d990c2 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -117,10 +117,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
117 | return new List<ILandObject>(); | 117 | return new List<ILandObject>(); |
118 | } | 118 | } |
119 | 119 | ||
120 | public void Clear() | 120 | public void Clear(bool setupDefaultParcel) |
121 | { | 121 | { |
122 | if (m_landManagementModule != null) | 122 | if (m_landManagementModule != null) |
123 | m_landManagementModule.Clear(); | 123 | m_landManagementModule.Clear(setupDefaultParcel); |
124 | } | 124 | } |
125 | 125 | ||
126 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | 126 | public List<ILandObject> ParcelsNearPoint(Vector3 position) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 7d030c7..a46be13 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -298,13 +298,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
298 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 298 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
299 | m_landIDList.Initialize(); | 299 | m_landIDList.Initialize(); |
300 | } | 300 | } |
301 | 301 | } | |
302 | |||
303 | /// <summary> | ||
304 | /// Create a default parcel that spans the entire region and is owned by the estate owner. | ||
305 | /// </summary> | ||
306 | /// <returns>The parcel created.</returns> | ||
307 | protected ILandObject CreateDefaultParcel() | ||
308 | { | ||
302 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | 309 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); |
303 | |||
304 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 310 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
305 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 311 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
306 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 312 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
307 | AddLandObject(fullSimParcel); | 313 | return AddLandObject(fullSimParcel); |
308 | } | 314 | } |
309 | 315 | ||
310 | public List<ILandObject> AllParcels() | 316 | public List<ILandObject> AllParcels() |
@@ -640,7 +646,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
640 | /// <summary> | 646 | /// <summary> |
641 | /// Clear the scene of all parcels | 647 | /// Clear the scene of all parcels |
642 | /// </summary> | 648 | /// </summary> |
643 | public void Clear() | 649 | public void Clear(bool setupDefaultParcel) |
644 | { | 650 | { |
645 | lock (m_landList) | 651 | lock (m_landList) |
646 | { | 652 | { |
@@ -654,6 +660,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
654 | } | 660 | } |
655 | 661 | ||
656 | ResetSimLandObjects(); | 662 | ResetSimLandObjects(); |
663 | |||
664 | if (setupDefaultParcel) | ||
665 | CreateDefaultParcel(); | ||
657 | } | 666 | } |
658 | 667 | ||
659 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 668 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
@@ -1321,7 +1330,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1321 | } | 1330 | } |
1322 | } | 1331 | } |
1323 | 1332 | ||
1324 | |||
1325 | void ClientOnParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client) | 1333 | void ClientOnParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client) |
1326 | { | 1334 | { |
1327 | ILandObject land; | 1335 | ILandObject land; |
@@ -1337,10 +1345,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1337 | { | 1345 | { |
1338 | land.DeedToGroup(groupID); | 1346 | land.DeedToGroup(groupID); |
1339 | } | 1347 | } |
1340 | |||
1341 | } | 1348 | } |
1342 | 1349 | ||
1343 | |||
1344 | #region Land Object From Storage Functions | 1350 | #region Land Object From Storage Functions |
1345 | 1351 | ||
1346 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) | 1352 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) |
@@ -1375,6 +1381,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1375 | public void EventManagerOnNoLandDataFromStorage() | 1381 | public void EventManagerOnNoLandDataFromStorage() |
1376 | { | 1382 | { |
1377 | ResetSimLandObjects(); | 1383 | ResetSimLandObjects(); |
1384 | CreateDefaultParcel(); | ||
1378 | } | 1385 | } |
1379 | 1386 | ||
1380 | #endregion | 1387 | #endregion |
@@ -1646,7 +1653,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1646 | 1653 | ||
1647 | protected void ClearCommand(Object[] args) | 1654 | protected void ClearCommand(Object[] args) |
1648 | { | 1655 | { |
1649 | Clear(); | 1656 | Clear(true); |
1650 | 1657 | ||
1651 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); | 1658 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); |
1652 | } | 1659 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs index 17570c6..30bae16 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs | |||
@@ -72,7 +72,10 @@ namespace OpenSim.Region.Framework.Interfaces | |||
72 | /// <summary> | 72 | /// <summary> |
73 | /// Clear the land channel of all parcels. | 73 | /// Clear the land channel of all parcels. |
74 | /// </summary> | 74 | /// </summary> |
75 | void Clear(); | 75 | /// <param name="setupDefaultParcel"> |
76 | /// If true, set up a default parcel covering the whole region owned by the estate owner. | ||
77 | /// </param> | ||
78 | void Clear(bool setupDefaultParcel); | ||
76 | 79 | ||
77 | bool IsLandPrimCountTainted(); | 80 | bool IsLandPrimCountTainted(); |
78 | bool IsForcefulBansAllowed(); | 81 | bool IsForcefulBansAllowed(); |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index c2480b7..98e5453 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |||
@@ -63,9 +63,9 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
63 | return RootRegionLandChannel.AllParcels(); | 63 | return RootRegionLandChannel.AllParcels(); |
64 | } | 64 | } |
65 | 65 | ||
66 | public void Clear() | 66 | public void Clear(bool setupDefaultParcel) |
67 | { | 67 | { |
68 | RootRegionLandChannel.Clear(); | 68 | RootRegionLandChannel.Clear(setupDefaultParcel); |
69 | } | 69 | } |
70 | 70 | ||
71 | public ILandObject GetLandObject(int x, int y) | 71 | public ILandObject GetLandObject(int x, int y) |
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 366af67..c3134b3 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock | |||
56 | return new List<ILandObject>(); | 56 | return new List<ILandObject>(); |
57 | } | 57 | } |
58 | 58 | ||
59 | public void Clear() | 59 | public void Clear(bool setupDefaultParcel) |
60 | { | 60 | { |
61 | // Intentionally blank since we don't save any parcel data in the test channel | 61 | // Intentionally blank since we don't save any parcel data in the test channel |
62 | } | 62 | } |