From 85d51e57a905ac8f823f345f525837926f4ed2ce Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 7 Apr 2014 09:25:18 +0300 Subject: When sending QueryAccess to a region, also send the user's Home URI --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 7 +++++-- .../ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 4 ++-- .../ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | 6 +++--- OpenSim/Region/Framework/Scenes/Scene.cs | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 3d9c93f..7e1d68d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -700,6 +700,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return; } + string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); + m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, @@ -744,7 +746,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string reason; string version; if (!Scene.SimulationService.QueryAccess( - finalDestination, sp.ControllingClient.AgentId, position, out version, out reason)) + finalDestination, sp.ControllingClient.AgentId, homeURI, position, out version, out reason)) { sp.ControllingClient.SendTeleportFailed(reason); @@ -1456,6 +1458,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer version = String.Empty; newpos = pos; failureReason = string.Empty; + string homeURI = scene.GetAgentHomeURI(agentID); // m_log.DebugFormat( // "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); @@ -1489,7 +1492,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // Check to see if we have access to the target region. if (neighbourRegion != null - && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out failureReason)) + && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, newpos, out version, out failureReason)) { // remember banned m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 4dcb99f..dc06e4b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs @@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return true; } - public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) { reason = "Communications failure"; version = ServiceVersion; @@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", // s.RegionInfo.RegionName, destination.RegionHandle); - return m_scenes[destination.RegionID].QueryAccess(id, position, out reason); + return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason); } //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index cc01430..5f43f08 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs @@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return m_remoteConnector.UpdateAgent(destination, cAgentData); } - public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) { reason = "Communications failure"; version = "Unknown"; @@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation return false; // Try local first - if (m_localBackend.QueryAccess(destination, id, position, out version, out reason)) + if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason)) return true; // else do the remote thing if (!m_localBackend.IsLocalRegion(destination.RegionID)) - return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason); + return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason); return false; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3ff21ea..4013fa7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5466,11 +5466,12 @@ namespace OpenSim.Region.Framework.Scenes /// or corssing the broder walking, but will NOT prevent /// child agent creation, thereby emulating the SL behavior. /// - /// + /// The visitor's User ID + /// The visitor's Home URI (may be null) /// /// /// - public bool QueryAccess(UUID agentID, Vector3 position, out string reason) + public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason) { reason = "You are banned from the region"; -- cgit v1.1