From 188d86998d14d23a59e345568add8ece7f5a0641 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 28 Jan 2011 04:09:04 +0000 Subject: Fix up QueryAccess to also check parcels --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 9 ++++++++- .../ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 9 +++------ .../ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | 6 +++--- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 7804b7f..54b95f7 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -284,6 +284,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return; } + if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero)) + { + sp.ControllingClient.SendTeleportFailed("The destination region has refused access"); + return; + } + sp.ControllingClient.SendTeleportStart(teleportFlags); // the avatar.Close below will clear the child region list. We need this below for (possibly) @@ -772,8 +778,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); - if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId)) + if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos)) { + agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel"); if (r == null) { r = new ExpiringCache(); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 2dd0099..c5972dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs @@ -257,18 +257,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return false; } - public bool QueryAccess(GridRegion destination, UUID id) + public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) { if (destination == null) return false; foreach (Scene s in m_sceneList) { - if (s.RegionInfo.RegionHandle == destination.RegionHandle) - { - //m_log.Debug("[LOCAL COMMS]: Found region to send QueryAccess"); - return s.QueryAccess(id); - } + if (s.RegionInfo.RegionID == destination.RegionID) + return s.QueryAccess(id, position); } //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); return false; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 387a9b8..c4919b3 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 } - public bool QueryAccess(GridRegion destination, UUID id) + public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) { if (destination == null) return false; // Try local first - if (m_localBackend.QueryAccess(destination, id)) + if (m_localBackend.QueryAccess(destination, id, position)) return true; // else do the remote thing if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) - return m_remoteConnector.QueryAccess(destination, id); + return m_remoteConnector.QueryAccess(destination, id, position); return false; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4325ab8..4fca261 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4921,7 +4921,7 @@ namespace OpenSim.Region.Framework.Scenes // from logging into the region, teleporting into the region // or corssing the broder walking, but will NOT prevent // child agent creation, thereby emulating the SL behavior. - public bool QueryAccess(UUID agentID) + public bool QueryAccess(UUID agentID, Vector3 position) { return true; } -- cgit v1.1