From 92e24780597322e58631abd9b9e3494ee3266996 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 21 Jul 2014 23:53:33 +0100 Subject: On login and first HG entrance to a foreign grid, perform query access checks before proceeding. --- .../Simulation/LocalSimulationConnector.cs | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index e6de0b6..50105a6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs @@ -283,18 +283,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation // s.RegionInfo.RegionName, destination.RegionHandle); uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; - float theirVersionNumber = 0f; - string[] versionComponents = theirversion.Split(new char[] { '/' }); - if (versionComponents.Length >= 2) - float.TryParse(versionComponents[1], out theirVersionNumber); - - // Var regions here, and the requesting simulator is in an older version. - // We will forbide this, because it crashes the viewers - if (theirVersionNumber < 0.3f && size > 256) + if (theirversion != null) { - reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; - m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); - return false; + float theirVersionNumber = 0f; + string[] versionComponents = theirversion.Split(new char[] { '/' }); + if (versionComponents.Length >= 2) + float.TryParse(versionComponents[1], out theirVersionNumber); + + // Var regions here, and the requesting simulator is in an older version. + // We will forbide this, because it crashes the viewers + if (theirVersionNumber < 0.3f && size > 256) + { + reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; + m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); + return false; + + } } return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); -- cgit v1.1