From 2d209d3844a58a4d27fe15aa5ccd497bbd530707 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Mar 2011 16:46:04 -0700 Subject: Fix mantis #5413. WARNING: new config variable in section [GridService] of the simulators called Gatekeeper -- intended to have the URL of the grid's Gatekeeper service (so that it can be checked against). See ini.examples. --- OpenSim/Services/GridService/HypergridLinker.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 12ea453..585d088 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -65,6 +65,7 @@ namespace OpenSim.Services.GridService protected UUID m_ScopeID = UUID.Zero; protected bool m_Check4096 = true; protected string m_MapTileDirectory = string.Empty; + protected string m_ThisGatekeeper = string.Empty; // Hyperlink regions are hyperlinks on the map public readonly Dictionary m_HyperlinkRegions = new Dictionary(); @@ -123,6 +124,8 @@ namespace OpenSim.Services.GridService m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); + m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); + m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); @@ -266,6 +269,13 @@ namespace OpenSim.Services.GridService regInfo.ScopeID = scopeID; regInfo.EstateOwner = ownerID; + // Make sure we're not hyperlinking to regions on this grid! + if (regInfo.ServerURI.Trim(new char[]{'/', ' '}) == m_ThisGatekeeper.Trim(new char[]{'/', ' '})) + { + reason = "Cannot hyperlink to regions on the same grid"; + return false; + } + // Check for free coordinates GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); if (region != null) -- cgit v1.1