diff options
author | Melanie | 2011-01-28 03:07:25 +0100 |
---|---|---|
committer | Melanie | 2011-01-28 03:07:25 +0100 |
commit | 657c14c5db8b0c882484926ba76aa64ec757ee07 (patch) | |
tree | 595a97b1a82144acade004772d65e018ca93426c /OpenSim/Region | |
parent | Comment a very spammy debug message that was being output directly to console. (diff) | |
download | opensim-SC_OLD-657c14c5db8b0c882484926ba76aa64ec757ee07.zip opensim-SC_OLD-657c14c5db8b0c882484926ba76aa64ec757ee07.tar.gz opensim-SC_OLD-657c14c5db8b0c882484926ba76aa64ec757ee07.tar.bz2 opensim-SC_OLD-657c14c5db8b0c882484926ba76aa64ec757ee07.tar.xz |
Fix up QueryAccess to also check parcels
Diffstat (limited to 'OpenSim/Region')
4 files changed, 30 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 016871f..9e1d414 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -285,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | 287 | ||
288 | if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId)) | 288 | if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero)) |
289 | { | 289 | { |
290 | sp.ControllingClient.SendTeleportFailed("The destination region has refused access"); | 290 | sp.ControllingClient.SendTeleportFailed("The destination region has refused access"); |
291 | return; | 291 | return; |
@@ -797,8 +797,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
797 | 797 | ||
798 | GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 798 | GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
799 | 799 | ||
800 | if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId)) | 800 | if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos)) |
801 | { | 801 | { |
802 | agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel"); | ||
802 | if (r == null) | 803 | if (r == null) |
803 | { | 804 | { |
804 | r = new ExpiringCache<ulong, DateTime>(); | 805 | r = new ExpiringCache<ulong, DateTime>(); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index aaf7bf3..971a56f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
257 | return false; | 257 | return false; |
258 | } | 258 | } |
259 | 259 | ||
260 | public bool QueryAccess(GridRegion destination, UUID id) | 260 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) |
261 | { | 261 | { |
262 | if (destination == null) | 262 | if (destination == null) |
263 | return false; | 263 | return false; |
@@ -265,7 +265,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
265 | foreach (Scene s in m_sceneList) | 265 | foreach (Scene s in m_sceneList) |
266 | { | 266 | { |
267 | if (s.RegionInfo.RegionID == destination.RegionID) | 267 | if (s.RegionInfo.RegionID == destination.RegionID) |
268 | return s.QueryAccess(id); | 268 | return s.QueryAccess(id, position); |
269 | } | 269 | } |
270 | return false; | 270 | return false; |
271 | } | 271 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 27792c8..e8a6629 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -239,18 +239,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
239 | 239 | ||
240 | } | 240 | } |
241 | 241 | ||
242 | public bool QueryAccess(GridRegion destination, UUID id) | 242 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) |
243 | { | 243 | { |
244 | if (destination == null) | 244 | if (destination == null) |
245 | return false; | 245 | return false; |
246 | 246 | ||
247 | // Try local first | 247 | // Try local first |
248 | if (m_localBackend.QueryAccess(destination, id)) | 248 | if (m_localBackend.QueryAccess(destination, id, position)) |
249 | return true; | 249 | return true; |
250 | 250 | ||
251 | // else do the remote thing | 251 | // else do the remote thing |
252 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 252 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) |
253 | return m_remoteConnector.QueryAccess(destination, id); | 253 | return m_remoteConnector.QueryAccess(destination, id, position); |
254 | 254 | ||
255 | return false; | 255 | return false; |
256 | 256 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5caf06c..c65a82b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5141,23 +5141,38 @@ namespace OpenSim.Region.Framework.Scenes | |||
5141 | // from logging into the region, teleporting into the region | 5141 | // from logging into the region, teleporting into the region |
5142 | // or corssing the broder walking, but will NOT prevent | 5142 | // or corssing the broder walking, but will NOT prevent |
5143 | // child agent creation, thereby emulating the SL behavior. | 5143 | // child agent creation, thereby emulating the SL behavior. |
5144 | public bool QueryAccess(UUID agentID) | 5144 | public bool QueryAccess(UUID agentID, Vector3 position) |
5145 | { | 5145 | { |
5146 | string reason; | 5146 | string reason; |
5147 | 5147 | ||
5148 | if (!AuthorizeUser(agentID, out reason)) | 5148 | if (!AuthorizeUser(agentID, out reason)) |
5149 | { | 5149 | { |
5150 | m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); | 5150 | // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); |
5151 | return false; | 5151 | return false; |
5152 | } | 5152 | } |
5153 | 5153 | ||
5154 | float posX = 128.0f; | 5154 | if (position == Vector3.Zero) // Teleport |
5155 | float posY = 128.0f; | 5155 | { |
5156 | float posX = 128.0f; | ||
5157 | float posY = 128.0f; | ||
5156 | 5158 | ||
5157 | if (!TestLandRestrictions(agentID, out reason, ref posX, ref posY)) | 5159 | if (!TestLandRestrictions(agentID, out reason, ref posX, ref posY)) |
5160 | { | ||
5161 | // m_log.DebugFormat("[SCENE]: Denying {0} because they are banned on all parcels", agentID); | ||
5162 | return false; | ||
5163 | } | ||
5164 | } | ||
5165 | else // Walking | ||
5158 | { | 5166 | { |
5159 | m_log.DebugFormat("[SCENE]: Denying {0} because they are banned on all parcels", agentID); | 5167 | ILandObject land = LandChannel.GetLandObject(position.X, position.Y); |
5160 | return false; | 5168 | if (land == null) |
5169 | return false; | ||
5170 | |||
5171 | bool banned = land.IsBannedFromLand(agentID); | ||
5172 | bool restricted = land.IsRestrictedFromLand(agentID); | ||
5173 | |||
5174 | if (banned || restricted) | ||
5175 | return false; | ||
5161 | } | 5176 | } |
5162 | return true; | 5177 | return true; |
5163 | } | 5178 | } |