GetRegionsByName and GetHypergridRegionByName: detect that provided url is for local grid, and make it a local by region name local search
parent
48efbeb8d3
commit
c0a23d36df
|
@ -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;
|
||||
|
||||
|
@ -554,8 +555,9 @@ namespace OpenSim.Services.GridService
|
|||
if(haveMatch)
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
string HGname = regionURI +" "+ regionName;
|
||||
if(!localGrid)
|
||||
{
|
||||
string HGname = regionURI +" "+ regionName; // include space for compatibility
|
||||
GridRegion r = m_HypergridLinker.LinkRegion(scopeID, HGname);
|
||||
if (r != null)
|
||||
{
|
||||
|
@ -564,6 +566,7 @@ namespace OpenSim.Services.GridService
|
|||
rinfos.Add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (rdatas != null && (rdatas.Count > 0))
|
||||
{
|
||||
// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
|
@ -597,10 +600,12 @@ namespace OpenSim.Services.GridService
|
|||
if ((rdatas != null) && (rdatas.Count > 0))
|
||||
return RegionData2RegionInfo(rdatas[0]); // get the first
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(regionURI))
|
||||
{
|
||||
string HGname = regionURI +" "+ regionName;
|
||||
return m_HypergridLinker.LinkRegion(scopeID, HGname);
|
||||
}
|
||||
else
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue