diff options
author | Oren Hurvitz | 2011-05-12 14:42:28 +0300 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-05-14 00:41:32 +0100 |
commit | 64d868fb64329b1c961dc8f520c71789bc146609 (patch) | |
tree | 603b781ed601f3cb872d331b9224a7cbe9beca8d | |
parent | The get_grid_info REST call now encodes XML Entities (diff) | |
download | opensim-SC-64d868fb64329b1c961dc8f520c71789bc146609.zip opensim-SC-64d868fb64329b1c961dc8f520c71789bc146609.tar.gz opensim-SC-64d868fb64329b1c961dc8f520c71789bc146609.tar.bz2 opensim-SC-64d868fb64329b1c961dc8f520c71789bc146609.tar.xz |
When loading an OAR that doesn't have parcels, create a default parcel
4 files changed, 31 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 82bef48..6461636 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -347,12 +347,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
347 | 347 | ||
348 | landData.Add(parcel); | 348 | landData.Add(parcel); |
349 | } | 349 | } |
350 | 350 | ||
351 | if (!m_merge) | 351 | if (!m_merge) |
352 | m_scene.LandChannel.Clear(false); | 352 | { |
353 | bool setupDefaultParcel = (landData.Count == 0); | ||
354 | m_scene.LandChannel.Clear(setupDefaultParcel); | ||
355 | } | ||
353 | 356 | ||
354 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | 357 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); |
355 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | 358 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); |
356 | } | 359 | } |
357 | 360 | ||
358 | /// <summary> | 361 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 2307c8e..729e9f7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -313,6 +313,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
313 | Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); | 313 | Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); |
314 | Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); | 314 | Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); |
315 | 315 | ||
316 | Assert.Greater(m_scene.LandChannel.AllParcels().Count, 0, "incorrect number of parcels"); | ||
317 | |||
316 | // Temporary | 318 | // Temporary |
317 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); | 319 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); |
318 | } | 320 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index bfab7b8..2eac79d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -668,14 +668,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
668 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); | 668 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); |
669 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); | 669 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); |
670 | } | 670 | } |
671 | 671 | ||
672 | m_landList.Clear(); | 672 | m_landList.Clear(); |
673 | |||
674 | ResetSimLandObjects(); | ||
675 | |||
676 | if (setupDefaultParcel) | ||
677 | CreateDefaultParcel(); | ||
673 | } | 678 | } |
674 | |||
675 | ResetSimLandObjects(); | ||
676 | |||
677 | if (setupDefaultParcel) | ||
678 | CreateDefaultParcel(); | ||
679 | } | 679 | } |
680 | 680 | ||
681 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 681 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
@@ -1391,8 +1391,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1391 | 1391 | ||
1392 | public void EventManagerOnNoLandDataFromStorage() | 1392 | public void EventManagerOnNoLandDataFromStorage() |
1393 | { | 1393 | { |
1394 | ResetSimLandObjects(); | 1394 | lock (m_landList) |
1395 | CreateDefaultParcel(); | 1395 | { |
1396 | ResetSimLandObjects(); | ||
1397 | CreateDefaultParcel(); | ||
1398 | } | ||
1396 | } | 1399 | } |
1397 | 1400 | ||
1398 | #endregion | 1401 | #endregion |
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index c3134b3..0e4dfb9 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs | |||
@@ -40,10 +40,12 @@ namespace OpenSim.Tests.Common.Mock | |||
40 | public class TestLandChannel : ILandChannel | 40 | public class TestLandChannel : ILandChannel |
41 | { | 41 | { |
42 | private Scene m_scene; | 42 | private Scene m_scene; |
43 | private List<ILandObject> m_parcels; | ||
43 | 44 | ||
44 | public TestLandChannel(Scene scene) | 45 | public TestLandChannel(Scene scene) |
45 | { | 46 | { |
46 | m_scene = scene; | 47 | m_scene = scene; |
48 | m_parcels = new List<ILandObject>(); | ||
47 | } | 49 | } |
48 | 50 | ||
49 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | 51 | public List<ILandObject> ParcelsNearPoint(Vector3 position) |
@@ -53,12 +55,19 @@ namespace OpenSim.Tests.Common.Mock | |||
53 | 55 | ||
54 | public List<ILandObject> AllParcels() | 56 | public List<ILandObject> AllParcels() |
55 | { | 57 | { |
56 | return new List<ILandObject>(); | 58 | return m_parcels; |
57 | } | 59 | } |
58 | 60 | ||
59 | public void Clear(bool setupDefaultParcel) | 61 | public void Clear(bool setupDefaultParcel) |
60 | { | 62 | { |
61 | // Intentionally blank since we don't save any parcel data in the test channel | 63 | m_parcels.Clear(); |
64 | |||
65 | if (setupDefaultParcel) | ||
66 | { | ||
67 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | ||
68 | obj.LandData.Name = "Your Parcel"; | ||
69 | m_parcels.Add(obj); | ||
70 | } | ||
62 | } | 71 | } |
63 | 72 | ||
64 | protected ILandObject GetNoLand() | 73 | protected ILandObject GetNoLand() |