From 9971766256e422aeb320827a51f041f3b732575b Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 31 Dec 2010 15:45:08 +0100 Subject: Implement Scope ID lookup on GetLandData. Stacked regions were not handled properly --- .../Land/LandServiceInConnectorModule.cs | 3 +- .../Land/LocalLandServiceConnector.cs | 3 +- .../Land/RemoteLandServiceConnector.cs | 7 ++- .../CoreModules/World/Land/LandManagementModule.cs | 68 +++++++++++----------- 4 files changed, 42 insertions(+), 39 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index 23251c9..fcc69e9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs @@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Server.Base; using OpenSim.Server.Handlers.Base; using OpenSim.Services.Interfaces; +using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land @@ -121,7 +122,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land #region ILandService - public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) + public LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) { m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}", regionHandle, m_Scenes.Count); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs index e15f624..86c0b85 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs @@ -35,6 +35,7 @@ using OpenSim.Server.Base; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; +using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land { @@ -116,7 +117,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land #region ILandService - public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) + public LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) { regionAccess = 2; m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}", diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs index 252d9e7..766ef81 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs @@ -36,6 +36,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using OpenSim.Server.Base; +using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land @@ -109,13 +110,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land #region ILandService - public override LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) + public override LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) { - LandData land = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess); + LandData land = m_LocalService.GetLandData(scopeID, regionHandle, x, y, out regionAccess); if (land != null) return land; - return base.GetLandData(regionHandle, x, y, out regionAccess); + return base.GetLandData(scopeID, regionHandle, x, y, out regionAccess); } #endregion ILandService diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index ac4705c..8a309f1 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1510,40 +1510,40 @@ namespace OpenSim.Region.CoreModules.World.Land if (parcelID == UUID.Zero) return; - ExtendedLandData data = - (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), - delegate(string id) - { - UUID parcel = UUID.Zero; - UUID.TryParse(id, out parcel); - // assume we've got the parcelID we just computed in RemoteParcelRequest - ExtendedLandData extLandData = new ExtendedLandData(); - Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, - out extLandData.X, out extLandData.Y); - m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", - extLandData.RegionHandle, extLandData.X, extLandData.Y); - - // for this region or for somewhere else? - if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) - { - extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; - extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; - } - else - { - ILandService landService = m_scene.RequestModuleInterface(); - extLandData.LandData = landService.GetLandData(extLandData.RegionHandle, - extLandData.X, - extLandData.Y, - out extLandData.RegionAccess); - if (extLandData.LandData == null) - { - // we didn't find the region/land => don't cache - return null; - } - } - return extLandData; - }); + ExtendedLandData data = (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), + delegate(string id) + { + UUID parcel = UUID.Zero; + UUID.TryParse(id, out parcel); + // assume we've got the parcelID we just computed in RemoteParcelRequest + ExtendedLandData extLandData = new ExtendedLandData(); + Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, + out extLandData.X, out extLandData.Y); + m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", + extLandData.RegionHandle, extLandData.X, extLandData.Y); + + // for this region or for somewhere else? + if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) + { + extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; + extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; + } + else + { + ILandService landService = m_scene.RequestModuleInterface(); + extLandData.LandData = landService.GetLandData(m_scene.RegionInfo.ScopeID, + extLandData.RegionHandle, + extLandData.X, + extLandData.Y, + out extLandData.RegionAccess); + if (extLandData.LandData == null) + { + // we didn't find the region/land => don't cache + return null; + } + } + return extLandData; + }); if (data != null) // if we found some data, send it { -- cgit v1.1