diff options
Merge branch 'master' into careminster-presence-refactor
6 files changed, 83 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index d948b82..29d0713 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -228,8 +228,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
228 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); | 228 | LandData parcel = LandDataSerializer.Deserialize(serialisedParcel); |
229 | if (!ResolveUserUuid(parcel.OwnerID)) | 229 | if (!ResolveUserUuid(parcel.OwnerID)) |
230 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 230 | parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
231 | |||
232 | // m_log.DebugFormat( | ||
233 | // "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}", | ||
234 | // parcel.Name, parcel.LocalID, parcel.Area); | ||
235 | |||
231 | landData.Add(parcel); | 236 | landData.Add(parcel); |
232 | } | 237 | } |
238 | |||
239 | if (!m_merge) | ||
240 | m_scene.LandChannel.Clear(false); | ||
241 | |||
233 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); | 242 | m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); |
234 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); | 243 | m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); |
235 | 244 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 9e27ef0..7d990c2 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 | |||
116 | 116 | ||
117 | return new List<ILandObject>(); | 117 | return new List<ILandObject>(); |
118 | } | 118 | } |
119 | |||
120 | public void Clear(bool setupDefaultParcel) | ||
121 | { | ||
122 | if (m_landManagementModule != null) | ||
123 | m_landManagementModule.Clear(setupDefaultParcel); | ||
124 | } | ||
119 | 125 | ||
120 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | 126 | public List<ILandObject> ParcelsNearPoint(Vector3 position) |
121 | { | 127 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index cb8c5de..a4e85d6 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -306,13 +306,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
306 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 306 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
307 | m_landIDList.Initialize(); | 307 | m_landIDList.Initialize(); |
308 | } | 308 | } |
309 | 309 | } | |
310 | |||
311 | /// <summary> | ||
312 | /// Create a default parcel that spans the entire region and is owned by the estate owner. | ||
313 | /// </summary> | ||
314 | /// <returns>The parcel created.</returns> | ||
315 | protected ILandObject CreateDefaultParcel() | ||
316 | { | ||
310 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | 317 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); |
311 | |||
312 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 318 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
313 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 319 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
314 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 320 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
315 | AddLandObject(fullSimParcel); | 321 | return AddLandObject(fullSimParcel); |
316 | } | 322 | } |
317 | 323 | ||
318 | public List<ILandObject> AllParcels() | 324 | public List<ILandObject> AllParcels() |
@@ -586,15 +592,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
586 | } | 592 | } |
587 | 593 | ||
588 | /// <summary> | 594 | /// <summary> |
589 | /// Creates a basic Parcel object without an owner (a zeroed key) | ||
590 | /// </summary> | ||
591 | /// <returns></returns> | ||
592 | public ILandObject CreateBaseLand() | ||
593 | { | ||
594 | return new LandObject(UUID.Zero, false, m_scene); | ||
595 | } | ||
596 | |||
597 | /// <summary> | ||
598 | /// Adds a land object to the stored list and adds them to the landIDList to what they own | 595 | /// Adds a land object to the stored list and adds them to the landIDList to what they own |
599 | /// </summary> | 596 | /// </summary> |
600 | /// <param name="new_land">The land object being added</param> | 597 | /// <param name="new_land">The land object being added</param> |
@@ -653,6 +650,28 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
653 | m_landList.Remove(local_id); | 650 | m_landList.Remove(local_id); |
654 | } | 651 | } |
655 | } | 652 | } |
653 | |||
654 | /// <summary> | ||
655 | /// Clear the scene of all parcels | ||
656 | /// </summary> | ||
657 | public void Clear(bool setupDefaultParcel) | ||
658 | { | ||
659 | lock (m_landList) | ||
660 | { | ||
661 | foreach (ILandObject lo in m_landList.Values) | ||
662 | { | ||
663 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); | ||
664 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); | ||
665 | } | ||
666 | |||
667 | m_landList.Clear(); | ||
668 | } | ||
669 | |||
670 | ResetSimLandObjects(); | ||
671 | |||
672 | if (setupDefaultParcel) | ||
673 | CreateDefaultParcel(); | ||
674 | } | ||
656 | 675 | ||
657 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 676 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
658 | { | 677 | { |
@@ -1323,7 +1342,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1323 | } | 1342 | } |
1324 | } | 1343 | } |
1325 | 1344 | ||
1326 | |||
1327 | void ClientOnParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client) | 1345 | void ClientOnParcelDeedToGroup(int parcelLocalID, UUID groupID, IClientAPI remote_client) |
1328 | { | 1346 | { |
1329 | ILandObject land; | 1347 | ILandObject land; |
@@ -1342,7 +1360,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1342 | EventManagerOnParcelPrimCountTainted(); | 1360 | EventManagerOnParcelPrimCountTainted(); |
1343 | } | 1361 | } |
1344 | 1362 | ||
1345 | |||
1346 | #region Land Object From Storage Functions | 1363 | #region Land Object From Storage Functions |
1347 | 1364 | ||
1348 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) | 1365 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) |
@@ -1390,6 +1407,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1390 | public void EventManagerOnNoLandDataFromStorage() | 1407 | public void EventManagerOnNoLandDataFromStorage() |
1391 | { | 1408 | { |
1392 | ResetSimLandObjects(); | 1409 | ResetSimLandObjects(); |
1410 | CreateDefaultParcel(); | ||
1393 | } | 1411 | } |
1394 | 1412 | ||
1395 | #endregion | 1413 | #endregion |
@@ -1963,14 +1981,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1963 | 1981 | ||
1964 | protected void InstallInterfaces() | 1982 | protected void InstallInterfaces() |
1965 | { | 1983 | { |
1966 | Command showCommand = | 1984 | Command clearCommand |
1967 | new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowParcelsCommand, "Shows all parcels on the current region."); | 1985 | = new Command("clear", CommandIntentions.COMMAND_HAZARDOUS, ClearCommand, "Clears all the parcels from the region."); |
1986 | Command showCommand | ||
1987 | = new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowParcelsCommand, "Shows all parcels on the region."); | ||
1968 | 1988 | ||
1989 | m_commander.RegisterCommand("clear", clearCommand); | ||
1969 | m_commander.RegisterCommand("show", showCommand); | 1990 | m_commander.RegisterCommand("show", showCommand); |
1970 | 1991 | ||
1971 | // Add this to our scene so scripts can call these functions | 1992 | // Add this to our scene so scripts can call these functions |
1972 | m_scene.RegisterModuleCommander(m_commander); | 1993 | m_scene.RegisterModuleCommander(m_commander); |
1973 | } | 1994 | } |
1995 | |||
1996 | protected void ClearCommand(Object[] args) | ||
1997 | { | ||
1998 | Clear(true); | ||
1999 | |||
2000 | MainConsole.Instance.OutputFormat("Cleared all parcels from {0}", m_scene.RegionInfo.RegionName); | ||
2001 | } | ||
1974 | 2002 | ||
1975 | protected void ShowParcelsCommand(Object[] args) | 2003 | protected void ShowParcelsCommand(Object[] args) |
1976 | { | 2004 | { |
@@ -1978,8 +2006,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1978 | 2006 | ||
1979 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); | 2007 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); |
1980 | report.AppendFormat( | 2008 | report.AppendFormat( |
1981 | "{0,-20} {1,-9} {2,-18} {3,-18} {4,-20}\n", | 2009 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", |
1982 | "Parcel Name", | 2010 | "Parcel Name", |
2011 | "Local ID", | ||
1983 | "Area", | 2012 | "Area", |
1984 | "Starts", | 2013 | "Starts", |
1985 | "Ends", | 2014 | "Ends", |
@@ -1992,12 +2021,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1992 | LandData ld = lo.LandData; | 2021 | LandData ld = lo.LandData; |
1993 | 2022 | ||
1994 | report.AppendFormat( | 2023 | report.AppendFormat( |
1995 | "{0,-20} {1,-9} {2,-18} {3,-18} {4,-20}\n", | 2024 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", |
1996 | ld.Name, ld.Area, lo.StartPoint, lo.EndPoint, m_userManager.GetUserName(ld.OwnerID)); | 2025 | ld.Name, ld.LocalID, ld.Area, lo.StartPoint, lo.EndPoint, m_userManager.GetUserName(ld.OwnerID)); |
1997 | } | 2026 | } |
1998 | } | 2027 | } |
1999 | 2028 | ||
2000 | MainConsole.Instance.Output(report.ToString()); | 2029 | MainConsole.Instance.Output(report.ToString()); |
2001 | } | 2030 | } |
2002 | } | 2031 | } |
2003 | } | 2032 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs index 20b8ab6..30bae16 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs | |||
@@ -69,6 +69,14 @@ namespace OpenSim.Region.Framework.Interfaces | |||
69 | /// <returns></returns> | 69 | /// <returns></returns> |
70 | ILandObject GetLandObject(int localID); | 70 | ILandObject GetLandObject(int localID); |
71 | 71 | ||
72 | /// <summary> | ||
73 | /// Clear the land channel of all parcels. | ||
74 | /// </summary> | ||
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); | ||
79 | |||
72 | bool IsLandPrimCountTainted(); | 80 | bool IsLandPrimCountTainted(); |
73 | bool IsForcefulBansAllowed(); | 81 | bool IsForcefulBansAllowed(); |
74 | void UpdateLandObject(int localID, LandData data); | 82 | void UpdateLandObject(int localID, LandData data); |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index be5411a..98e5453 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |||
@@ -62,6 +62,11 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
62 | { | 62 | { |
63 | return RootRegionLandChannel.AllParcels(); | 63 | return RootRegionLandChannel.AllParcels(); |
64 | } | 64 | } |
65 | |||
66 | public void Clear(bool setupDefaultParcel) | ||
67 | { | ||
68 | RootRegionLandChannel.Clear(setupDefaultParcel); | ||
69 | } | ||
65 | 70 | ||
66 | public ILandObject GetLandObject(int x, int y) | 71 | public ILandObject GetLandObject(int x, int y) |
67 | { | 72 | { |
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 159764c..c3134b3 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs | |||
@@ -55,6 +55,11 @@ namespace OpenSim.Tests.Common.Mock | |||
55 | { | 55 | { |
56 | return new List<ILandObject>(); | 56 | return new List<ILandObject>(); |
57 | } | 57 | } |
58 | |||
59 | public void Clear(bool setupDefaultParcel) | ||
60 | { | ||
61 | // Intentionally blank since we don't save any parcel data in the test channel | ||
62 | } | ||
58 | 63 | ||
59 | protected ILandObject GetNoLand() | 64 | protected ILandObject GetNoLand() |
60 | { | 65 | { |