diff options
author | Melanie | 2011-02-16 05:22:05 +0100 |
---|---|---|
committer | Melanie | 2011-02-16 05:22:05 +0100 |
commit | cfce0aa4482c50e3046ae44fe76d71fb70c82201 (patch) | |
tree | 41ce0f2a9b7ee144827eb5620cdba8a0db0f4245 /OpenSim/Region | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-cfce0aa4482c50e3046ae44fe76d71fb70c82201.zip opensim-SC-cfce0aa4482c50e3046ae44fe76d71fb70c82201.tar.gz opensim-SC-cfce0aa4482c50e3046ae44fe76d71fb70c82201.tar.bz2 opensim-SC-cfce0aa4482c50e3046ae44fe76d71fb70c82201.tar.xz |
Change the QUERYACCESS method to eliminate spurious access denied messages
Diffstat (limited to 'OpenSim/Region')
4 files changed, 16 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index e8f18e7..51897d7 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -285,9 +285,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | 287 | ||
288 | if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero)) | 288 | string reason; |
289 | if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out reason)) | ||
289 | { | 290 | { |
290 | sp.ControllingClient.SendTeleportFailed("The destination region has refused access"); | 291 | sp.ControllingClient.SendTeleportFailed("Teleport failed: " + reason); |
291 | return; | 292 | return; |
292 | } | 293 | } |
293 | 294 | ||
@@ -324,8 +325,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
324 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); | 325 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); |
325 | } | 326 | } |
326 | 327 | ||
327 | string reason = String.Empty; | ||
328 | |||
329 | // Let's create an agent there if one doesn't exist yet. | 328 | // Let's create an agent there if one doesn't exist yet. |
330 | bool logout = false; | 329 | bool logout = false; |
331 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 330 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) |
@@ -797,7 +796,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
797 | 796 | ||
798 | GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 797 | GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
799 | 798 | ||
800 | if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos)) | 799 | string reason; |
800 | if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out reason)) | ||
801 | { | 801 | { |
802 | agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel"); | 802 | agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel"); |
803 | if (r == null) | 803 | if (r == null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 9363714..41dbffb 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -257,15 +257,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
257 | return false; | 257 | return false; |
258 | } | 258 | } |
259 | 259 | ||
260 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) | 260 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason) |
261 | { | 261 | { |
262 | reason = "Communications failure"; | ||
262 | if (destination == null) | 263 | if (destination == null) |
263 | return false; | 264 | return false; |
264 | 265 | ||
265 | foreach (Scene s in m_sceneList) | 266 | foreach (Scene s in m_sceneList) |
266 | { | 267 | { |
267 | if (s.RegionInfo.RegionID == destination.RegionID) | 268 | if (s.RegionInfo.RegionID == destination.RegionID) |
268 | return s.QueryAccess(id, position); | 269 | return s.QueryAccess(id, position, out reason); |
269 | } | 270 | } |
270 | return false; | 271 | return false; |
271 | } | 272 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index e8a6629..e1eee3b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -239,18 +239,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
239 | 239 | ||
240 | } | 240 | } |
241 | 241 | ||
242 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) | 242 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason) |
243 | { | 243 | { |
244 | reason = "Communications failure"; | ||
244 | if (destination == null) | 245 | if (destination == null) |
245 | return false; | 246 | return false; |
246 | 247 | ||
247 | // Try local first | 248 | // Try local first |
248 | if (m_localBackend.QueryAccess(destination, id, position)) | 249 | if (m_localBackend.QueryAccess(destination, id, position, out reason)) |
249 | return true; | 250 | return true; |
250 | 251 | ||
251 | // else do the remote thing | 252 | // else do the remote thing |
252 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 253 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) |
253 | return m_remoteConnector.QueryAccess(destination, id, position); | 254 | return m_remoteConnector.QueryAccess(destination, id, position, out reason); |
254 | 255 | ||
255 | return false; | 256 | return false; |
256 | 257 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 171d637..f38a6fc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5145,9 +5145,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
5145 | // from logging into the region, teleporting into the region | 5145 | // from logging into the region, teleporting into the region |
5146 | // or corssing the broder walking, but will NOT prevent | 5146 | // or corssing the broder walking, but will NOT prevent |
5147 | // child agent creation, thereby emulating the SL behavior. | 5147 | // child agent creation, thereby emulating the SL behavior. |
5148 | public bool QueryAccess(UUID agentID, Vector3 position) | 5148 | public bool QueryAccess(UUID agentID, Vector3 position, out string reason) |
5149 | { | 5149 | { |
5150 | string reason; | 5150 | reason = "You are banned from the region"; |
5151 | 5151 | ||
5152 | if (!AuthorizeUser(agentID, out reason)) | 5152 | if (!AuthorizeUser(agentID, out reason)) |
5153 | { | 5153 | { |
@@ -5178,6 +5178,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
5178 | if (banned || restricted) | 5178 | if (banned || restricted) |
5179 | return false; | 5179 | return false; |
5180 | } | 5180 | } |
5181 | |||
5182 | reason = String.Empty; | ||
5181 | return true; | 5183 | return true; |
5182 | } | 5184 | } |
5183 | } | 5185 | } |