mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
give more use to GridInfo for gatekeeper url
This commit is contained in:
@@ -509,9 +509,8 @@ namespace OpenSim.Services.GridService
|
||||
if (m_AllowHypergridMapSearch && name.Contains("."))
|
||||
{
|
||||
string regionURI = "";
|
||||
string regionHost = "";
|
||||
string regionName = "";
|
||||
if (!Util.buildHGRegionURI(name, out regionURI, out regionHost, out regionName))
|
||||
if (!Util.buildHGRegionURI(name, out regionURI, out regionName))
|
||||
return null;
|
||||
|
||||
string mapname;
|
||||
@@ -616,12 +615,11 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
string regionURI = "";
|
||||
string regionName = "";
|
||||
string regionHost = "";
|
||||
if (!Util.buildHGRegionURI(name, out regionURI, out regionHost, out regionName))
|
||||
if (!Util.buildHGRegionURI(name, out regionURI, out regionName))
|
||||
return null;
|
||||
|
||||
string mapname;
|
||||
bool localGrid = m_HypergridLinker.IsLocalGrid(regionHost);
|
||||
bool localGrid = m_HypergridLinker.IsLocalGrid(regionURI);
|
||||
if (localGrid)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(regionName))
|
||||
|
||||
@@ -67,10 +67,6 @@ namespace OpenSim.Services.GridService
|
||||
protected string m_MapTileDirectory = string.Empty;
|
||||
|
||||
protected GridInfo m_ThisGridInfo;
|
||||
//protected string m_ThisGatekeeperURI = string.Empty;
|
||||
//protected string m_ThisGatekeeperHost = string.Empty;
|
||||
//protected string m_ThisGateKeeperIP = string.Empty;
|
||||
//protected HashSet<string> m_ThisGateKeeperAlias = new HashSet<string>();
|
||||
|
||||
public HypergridLinker(IConfigSource config, GridService gridService, IRegionData db)
|
||||
{
|
||||
@@ -100,31 +96,6 @@ namespace OpenSim.Services.GridService
|
||||
|
||||
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
|
||||
|
||||
/*
|
||||
m_ThisGatekeeperURI = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI",
|
||||
new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty);
|
||||
m_ThisGatekeeperURI = gridConfig.GetString("Gatekeeper", m_ThisGatekeeperURI);
|
||||
|
||||
if(!Util.checkServiceURI(m_ThisGatekeeperURI, out m_ThisGatekeeperURI, out m_ThisGatekeeperHost, out m_ThisGateKeeperIP))
|
||||
{
|
||||
m_log.ErrorFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeperURI);
|
||||
throw new Exception("Failed to resolve gatekeeper external IP, please check GatekeeperURI configuration");
|
||||
}
|
||||
|
||||
string gatekeeperURIAlias = Util.GetConfigVarFromSections<string>(config, "GatekeeperURIAlias",
|
||||
new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty);
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(gatekeeperURIAlias))
|
||||
{
|
||||
string[] alias = gatekeeperURIAlias.Split(',');
|
||||
for(int i = 0; i < alias.Length; ++i)
|
||||
{
|
||||
if(!string.IsNullOrWhiteSpace(alias[i]))
|
||||
m_ThisGateKeeperAlias.Add(alias[i].Trim().ToLower());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
m_ThisGridInfo = new GridInfo(config);
|
||||
m_log.DebugFormat("[HYPERGRID LINKER]: Local Gatekeeper: {0}", m_ThisGridInfo.GateKeeperURL);
|
||||
|
||||
@@ -193,10 +164,9 @@ namespace OpenSim.Services.GridService
|
||||
GridRegion regInfo = null;
|
||||
|
||||
string serverURI = string.Empty;
|
||||
string regionHost = string.Empty;
|
||||
string regionName = string.Empty;
|
||||
|
||||
if (!Util.buildHGRegionURI(mapName, out serverURI, out regionHost, out regionName))
|
||||
if (!Util.buildHGRegionURI(mapName, out serverURI, out regionName))
|
||||
{
|
||||
reason = "Wrong URI format for link-region";
|
||||
return null;
|
||||
@@ -262,21 +232,6 @@ namespace OpenSim.Services.GridService
|
||||
regInfo.ScopeID = scopeID;
|
||||
regInfo.EstateOwner = ownerID;
|
||||
|
||||
// Make sure we're not hyperlinking to regions on this grid!
|
||||
/*
|
||||
if (!String.IsNullOrWhiteSpace(m_ThisGateKeeperIP))
|
||||
{
|
||||
if (m_ThisGatekeeperHost.Equals(regInfo.ExternalHostName, StringComparison.InvariantCultureIgnoreCase)
|
||||
|| m_ThisGateKeeperIP.Equals(regInfo.ExternalHostName)
|
||||
|| m_ThisGateKeeperAlias.Contains(regInfo.ExternalHostName.ToLower()))
|
||||
{
|
||||
m_log.InfoFormat("[HYPERGRID LINKER]: Cannot hyperlink to regions on the same grid");
|
||||
reason = "Cannot hyperlink to regions on the same grid";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if(IsLocalGrid(regInfo.ServerURI))
|
||||
{
|
||||
m_log.InfoFormat("[HYPERGRID LINKER]: Cannot hyperlink to regions on the same grid");
|
||||
|
||||
Reference in New Issue
Block a user