Improvement over 2 commits ago: make the hyperlink check understand port 80.
parent
d3771e5366
commit
309eb712a3
|
@ -66,6 +66,7 @@ namespace OpenSim.Services.GridService
|
||||||
protected bool m_Check4096 = true;
|
protected bool m_Check4096 = true;
|
||||||
protected string m_MapTileDirectory = string.Empty;
|
protected string m_MapTileDirectory = string.Empty;
|
||||||
protected string m_ThisGatekeeper = string.Empty;
|
protected string m_ThisGatekeeper = string.Empty;
|
||||||
|
protected Uri m_ThisGatekeeperURI = null;
|
||||||
|
|
||||||
// Hyperlink regions are hyperlinks on the map
|
// Hyperlink regions are hyperlinks on the map
|
||||||
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
|
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
|
||||||
|
@ -125,6 +126,14 @@ namespace OpenSim.Services.GridService
|
||||||
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
|
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
|
||||||
|
|
||||||
m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
|
m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper);
|
||||||
|
}
|
||||||
|
|
||||||
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
||||||
|
|
||||||
|
@ -249,6 +258,8 @@ namespace OpenSim.Services.GridService
|
||||||
remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
|
remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
|
||||||
|
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
Uri uri = null;
|
||||||
|
|
||||||
regInfo = new GridRegion();
|
regInfo = new GridRegion();
|
||||||
if ( externalPort > 0)
|
if ( externalPort > 0)
|
||||||
regInfo.HttpPort = externalPort;
|
regInfo.HttpPort = externalPort;
|
||||||
|
@ -259,7 +270,16 @@ namespace OpenSim.Services.GridService
|
||||||
else
|
else
|
||||||
regInfo.ExternalHostName = "0.0.0.0";
|
regInfo.ExternalHostName = "0.0.0.0";
|
||||||
if ( serverURI != null)
|
if ( serverURI != null)
|
||||||
|
{
|
||||||
regInfo.ServerURI = serverURI;
|
regInfo.ServerURI = serverURI;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
uri = new Uri(serverURI);
|
||||||
|
regInfo.ExternalHostName = uri.Host;
|
||||||
|
regInfo.HttpPort = (uint)uri.Port;
|
||||||
|
}
|
||||||
|
catch {}
|
||||||
|
}
|
||||||
|
|
||||||
if ( remoteRegionName != string.Empty )
|
if ( remoteRegionName != string.Empty )
|
||||||
regInfo.RegionName = remoteRegionName;
|
regInfo.RegionName = remoteRegionName;
|
||||||
|
@ -270,11 +290,16 @@ namespace OpenSim.Services.GridService
|
||||||
regInfo.EstateOwner = ownerID;
|
regInfo.EstateOwner = ownerID;
|
||||||
|
|
||||||
// Make sure we're not hyperlinking to regions on this grid!
|
// Make sure we're not hyperlinking to regions on this grid!
|
||||||
if (regInfo.ServerURI.Trim(new char[]{'/', ' '}) == m_ThisGatekeeper.Trim(new char[]{'/', ' '}))
|
if (m_ThisGatekeeperURI != null)
|
||||||
|
{
|
||||||
|
if (regInfo.ExternalHostName == m_ThisGatekeeperURI.Host && regInfo.HttpPort == m_ThisGatekeeperURI.Port)
|
||||||
{
|
{
|
||||||
reason = "Cannot hyperlink to regions on the same grid";
|
reason = "Cannot hyperlink to regions on the same grid";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_log.WarnFormat("[HYPERGRID LINKER]: Please set this grid's Gatekeeper's address in [GridService]!");
|
||||||
|
|
||||||
// Check for free coordinates
|
// Check for free coordinates
|
||||||
GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
|
GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
|
||||||
|
|
Loading…
Reference in New Issue