aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-01-27 20:29:06 +0000
committerJustin Clark-Casey (justincc)2011-01-27 20:36:50 +0000
commitbe3685b1a2ef8ebab25739fc5a5d632ed7359728 (patch)
treeaeb319707ad5cffedf9f9756e74e8833c3d30eb4 /OpenSim/Region/CoreModules/World/Land
parentShow local IDs in "land show" output. (diff)
downloadopensim-SC-be3685b1a2ef8ebab25739fc5a5d632ed7359728.zip
opensim-SC-be3685b1a2ef8ebab25739fc5a5d632ed7359728.tar.gz
opensim-SC-be3685b1a2ef8ebab25739fc5a5d632ed7359728.tar.bz2
opensim-SC-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/Region/CoreModules/World/Land')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandChannel.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs23
2 files changed, 17 insertions, 10 deletions
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 }