diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 31a186ab3c..82b910ad93 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -508,6 +508,7 @@ namespace OpenSim.Services.GridService if(!m_HypergridLinker.buildHGRegionURI(name, out regionURI, out regionName)) return null; + bool localGrid = string.IsNullOrWhiteSpace(regionURI); string mapname = regionURI + regionName; bool haveMatch = false; @@ -531,7 +532,7 @@ namespace OpenSim.Services.GridService if(haveMatch) return rinfos; } - + rdatas = m_Database.Get(Util.EscapeForLike(mapname)+ "%", scopeID); if (rdatas != null && (rdatas.Count > 0)) { @@ -554,14 +555,16 @@ namespace OpenSim.Services.GridService if(haveMatch) return rinfos; } - - string HGname = regionURI +" "+ regionName; - GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname); - if (r != null) + if(!localGrid) { - if( count == maxNumber) - rinfos.RemoveAt(count - 1); - rinfos.Add(r); + string HGname = regionURI +" "+ regionName; // include space for compatibility + GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname); + if (r != null) + { + if( count == maxNumber) + rinfos.RemoveAt(count - 1); + rinfos.Add(r); + } } } else if (rdatas != null && (rdatas.Count > 0)) @@ -597,11 +600,13 @@ namespace OpenSim.Services.GridService if ((rdatas != null) && (rdatas.Count > 0)) return RegionData2RegionInfo(rdatas[0]); // get the first - string HGname = regionURI +" "+ regionName; - return m_HypergridLinker.LinkRegion(scopeID, HGname); + if(!string.IsNullOrWhiteSpace(regionURI)) + { + string HGname = regionURI +" "+ regionName; + return m_HypergridLinker.LinkRegion(scopeID, HGname); + } } - else - return null; + return null; } public List GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index ceb2c6e7bb..185f2ff716 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -137,6 +137,12 @@ namespace OpenSim.Services.GridService m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); } + m_ThisGatekeeper = m_ThisGatekeeperURI.AbsoluteUri; + if(m_ThisGatekeeperURI.Port == 80) + m_ThisGatekeeper = m_ThisGatekeeper.Trim(new char[] { '/', ' ' }) +":80/"; + else if(m_ThisGatekeeperURI.Port == 443) + m_ThisGatekeeper = m_ThisGatekeeper.Trim(new char[] { '/', ' ' }) +":443/"; + m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); @@ -302,6 +308,10 @@ namespace OpenSim.Services.GridService serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":80/"; else if(uri.Port == 443) serverURI = serverURI.Trim(new char[] { '/', ' ' }) +":443/"; + + if(serverURI == m_ThisGatekeeper) + serverURI = ""; // local grid, look for region name only + return true; }