diff options
author | Melanie | 2010-12-31 15:45:08 +0100 |
---|---|---|
committer | Melanie | 2010-12-31 15:45:08 +0100 |
commit | 6820deed34fa87bc9b02376b382bae902052af9f (patch) | |
tree | 5efa55542a661607466e46abc593ed1956b0ade7 | |
parent | Add MessageKey to section Messaging, a key that prevents injection of (diff) | |
download | opensim-SC-6820deed34fa87bc9b02376b382bae902052af9f.zip opensim-SC-6820deed34fa87bc9b02376b382bae902052af9f.tar.gz opensim-SC-6820deed34fa87bc9b02376b382bae902052af9f.tar.bz2 opensim-SC-6820deed34fa87bc9b02376b382bae902052af9f.tar.xz |
Implement Scope ID lookup on GetLandData. Stacked regions were not handled
properly
8 files changed, 47 insertions, 44 deletions
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; | |||
37 | using OpenSim.Server.Base; | 37 | using OpenSim.Server.Base; |
38 | using OpenSim.Server.Handlers.Base; | 38 | using OpenSim.Server.Handlers.Base; |
39 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
40 | using OpenMetaverse; | ||
40 | 41 | ||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land |
@@ -121,7 +122,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land | |||
121 | 122 | ||
122 | #region ILandService | 123 | #region ILandService |
123 | 124 | ||
124 | public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) | 125 | public LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) |
125 | { | 126 | { |
126 | m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}", | 127 | m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}", |
127 | regionHandle, m_Scenes.Count); | 128 | 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; | |||
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | using OpenMetaverse; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | 40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land |
40 | { | 41 | { |
@@ -116,7 +117,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
116 | 117 | ||
117 | #region ILandService | 118 | #region ILandService |
118 | 119 | ||
119 | public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) | 120 | public LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) |
120 | { | 121 | { |
121 | regionAccess = 2; | 122 | regionAccess = 2; |
122 | m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}", | 123 | 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; | |||
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Server.Base; | 38 | using OpenSim.Server.Base; |
39 | using OpenMetaverse; | ||
39 | 40 | ||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land |
@@ -109,13 +110,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
109 | 110 | ||
110 | #region ILandService | 111 | #region ILandService |
111 | 112 | ||
112 | public override LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) | 113 | public override LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) |
113 | { | 114 | { |
114 | LandData land = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess); | 115 | LandData land = m_LocalService.GetLandData(scopeID, regionHandle, x, y, out regionAccess); |
115 | if (land != null) | 116 | if (land != null) |
116 | return land; | 117 | return land; |
117 | 118 | ||
118 | return base.GetLandData(regionHandle, x, y, out regionAccess); | 119 | return base.GetLandData(scopeID, regionHandle, x, y, out regionAccess); |
119 | 120 | ||
120 | } | 121 | } |
121 | #endregion ILandService | 122 | #endregion ILandService |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 8449cc1..001ad87 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1535,40 +1535,40 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1535 | if (parcelID == UUID.Zero) | 1535 | if (parcelID == UUID.Zero) |
1536 | return; | 1536 | return; |
1537 | 1537 | ||
1538 | ExtendedLandData data = | 1538 | ExtendedLandData data = (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), |
1539 | (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), | 1539 | delegate(string id) |
1540 | delegate(string id) | 1540 | { |
1541 | { | 1541 | UUID parcel = UUID.Zero; |
1542 | UUID parcel = UUID.Zero; | 1542 | UUID.TryParse(id, out parcel); |
1543 | UUID.TryParse(id, out parcel); | 1543 | // assume we've got the parcelID we just computed in RemoteParcelRequest |
1544 | // assume we've got the parcelID we just computed in RemoteParcelRequest | 1544 | ExtendedLandData extLandData = new ExtendedLandData(); |
1545 | ExtendedLandData extLandData = new ExtendedLandData(); | 1545 | Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, |
1546 | Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, | 1546 | out extLandData.X, out extLandData.Y); |
1547 | out extLandData.X, out extLandData.Y); | 1547 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", |
1548 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", | 1548 | extLandData.RegionHandle, extLandData.X, extLandData.Y); |
1549 | extLandData.RegionHandle, extLandData.X, extLandData.Y); | 1549 | |
1550 | 1550 | // for this region or for somewhere else? | |
1551 | // for this region or for somewhere else? | 1551 | if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) |
1552 | if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) | 1552 | { |
1553 | { | 1553 | extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; |
1554 | extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; | 1554 | extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; |
1555 | extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; | 1555 | } |
1556 | } | 1556 | else |
1557 | else | 1557 | { |
1558 | { | 1558 | ILandService landService = m_scene.RequestModuleInterface<ILandService>(); |
1559 | ILandService landService = m_scene.RequestModuleInterface<ILandService>(); | 1559 | extLandData.LandData = landService.GetLandData(m_scene.RegionInfo.ScopeID, |
1560 | extLandData.LandData = landService.GetLandData(extLandData.RegionHandle, | 1560 | extLandData.RegionHandle, |
1561 | extLandData.X, | 1561 | extLandData.X, |
1562 | extLandData.Y, | 1562 | extLandData.Y, |
1563 | out extLandData.RegionAccess); | 1563 | out extLandData.RegionAccess); |
1564 | if (extLandData.LandData == null) | 1564 | if (extLandData.LandData == null) |
1565 | { | 1565 | { |
1566 | // we didn't find the region/land => don't cache | 1566 | // we didn't find the region/land => don't cache |
1567 | return null; | 1567 | return null; |
1568 | } | 1568 | } |
1569 | } | 1569 | } |
1570 | return extLandData; | 1570 | return extLandData; |
1571 | }); | 1571 | }); |
1572 | 1572 | ||
1573 | if (data != null) // if we found some data, send it | 1573 | if (data != null) // if we found some data, send it |
1574 | { | 1574 | { |
diff --git a/OpenSim/Server/Handlers/Land/LandHandlers.cs b/OpenSim/Server/Handlers/Land/LandHandlers.cs index 561f285..b45289a 100644 --- a/OpenSim/Server/Handlers/Land/LandHandlers.cs +++ b/OpenSim/Server/Handlers/Land/LandHandlers.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Server.Handlers.Land | |||
67 | m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle); | 67 | m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle); |
68 | 68 | ||
69 | byte regionAccess; | 69 | byte regionAccess; |
70 | LandData landData = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess); | 70 | LandData landData = m_LocalService.GetLandData(UUID.Zero, regionHandle, x, y, out regionAccess); |
71 | Hashtable hash = new Hashtable(); | 71 | Hashtable hash = new Hashtable(); |
72 | if (landData != null) | 72 | if (landData != null) |
73 | { | 73 | { |
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 10499e2..ba39c99 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors | |||
64 | m_GridService = gridServices; | 64 | m_GridService = gridServices; |
65 | } | 65 | } |
66 | 66 | ||
67 | public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) | 67 | public virtual LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) |
68 | { | 68 | { |
69 | LandData landData = null; | 69 | LandData landData = null; |
70 | Hashtable hash = new Hashtable(); | 70 | Hashtable hash = new Hashtable(); |
@@ -80,7 +80,7 @@ namespace OpenSim.Services.Connectors | |||
80 | { | 80 | { |
81 | uint xpos = 0, ypos = 0; | 81 | uint xpos = 0, ypos = 0; |
82 | Utils.LongToUInts(regionHandle, out xpos, out ypos); | 82 | Utils.LongToUInts(regionHandle, out xpos, out ypos); |
83 | GridRegion info = m_GridService.GetRegionByPosition(UUID.Zero, (int)xpos, (int)ypos); | 83 | GridRegion info = m_GridService.GetRegionByPosition(scopeID, (int)xpos, (int)ypos); |
84 | if (info != null) // just to be sure | 84 | if (info != null) // just to be sure |
85 | { | 85 | { |
86 | XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); | 86 | XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); |
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs index 93da10e..9e444c4 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Services.Connectors | |||
71 | { | 71 | { |
72 | uint x = 0, y = 0; | 72 | uint x = 0, y = 0; |
73 | Utils.LongToUInts(regionHandle, out x, out y); | 73 | Utils.LongToUInts(regionHandle, out x, out y); |
74 | GridRegion regInfo = m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 74 | GridRegion regInfo = m_GridService.GetRegionByPosition(thisRegion.ScopeID, (int)x, (int)y); |
75 | if ((regInfo != null) && | 75 | if ((regInfo != null) && |
76 | // Don't remote-call this instance; that's a startup hickup | 76 | // Don't remote-call this instance; that's a startup hickup |
77 | !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort))) | 77 | !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort))) |
diff --git a/OpenSim/Services/Interfaces/ILandService.cs b/OpenSim/Services/Interfaces/ILandService.cs index 7a12aff..63d9a27 100644 --- a/OpenSim/Services/Interfaces/ILandService.cs +++ b/OpenSim/Services/Interfaces/ILandService.cs | |||
@@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces | |||
33 | { | 33 | { |
34 | public interface ILandService | 34 | public interface ILandService |
35 | { | 35 | { |
36 | LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess); | 36 | LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess); |
37 | } | 37 | } |
38 | } | 38 | } |