mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
Added ExternalName config on Gatekeeper.
This commit is contained in:
@@ -45,11 +45,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
return "/foreignobject/";
|
||||
}
|
||||
|
||||
public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string imageURL, out string reason)
|
||||
public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason)
|
||||
{
|
||||
regionID = UUID.Zero;
|
||||
imageURL = string.Empty;
|
||||
realHandle = 0;
|
||||
externalName = string.Empty;
|
||||
reason = string.Empty;
|
||||
|
||||
Hashtable hash = new Hashtable();
|
||||
@@ -97,9 +98,9 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
//m_log.Debug(">> HERE, realHandle: " + realHandle);
|
||||
}
|
||||
if (hash["region_image"] != null)
|
||||
{
|
||||
imageURL = (string)hash["region_image"];
|
||||
}
|
||||
if (hash["external_name"] != null)
|
||||
externalName = (string)hash["external_name"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -214,8 +214,9 @@ namespace OpenSim.Services.GridService
|
||||
// Finally, link it
|
||||
ulong handle = 0;
|
||||
UUID regionID = UUID.Zero;
|
||||
string externalName = string.Empty;
|
||||
string imageURL = string.Empty;
|
||||
if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out imageURL, out reason))
|
||||
if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason))
|
||||
return false;
|
||||
|
||||
if (regionID != UUID.Zero)
|
||||
@@ -229,11 +230,22 @@ namespace OpenSim.Services.GridService
|
||||
}
|
||||
|
||||
regInfo.RegionID = regionID;
|
||||
Uri uri = null;
|
||||
try
|
||||
{
|
||||
uri = new Uri(externalName);
|
||||
regInfo.ExternalHostName = uri.Host;
|
||||
regInfo.HttpPort = (uint)uri.Port;
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName);
|
||||
}
|
||||
regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName;
|
||||
// Try get the map image
|
||||
regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
|
||||
//regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
|
||||
// I need a texture that works for this... the one I tried doesn't seem to be working
|
||||
//regInfo.TerrainImage = m_HGMapImage;
|
||||
regInfo.TerrainImage = m_HGMapImage;
|
||||
|
||||
AddHyperlinkRegion(regInfo, handle);
|
||||
m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
UUID m_ScopeID;
|
||||
bool m_AllowTeleportsToAnyRegion;
|
||||
string m_ExternalName;
|
||||
GridRegion m_DefaultGatewayRegion;
|
||||
|
||||
public GatekeeperService(IConfigSource config, ISimulationService simService)
|
||||
@@ -83,6 +84,7 @@ namespace OpenSim.Services.HypergridService
|
||||
UUID.TryParse(scope, out m_ScopeID);
|
||||
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
|
||||
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
|
||||
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||
@@ -109,10 +111,11 @@ namespace OpenSim.Services.HypergridService
|
||||
{
|
||||
}
|
||||
|
||||
public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason)
|
||||
public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason)
|
||||
{
|
||||
regionID = UUID.Zero;
|
||||
regionHandle = 0;
|
||||
externalName = m_ExternalName;
|
||||
imageURL = string.Empty;
|
||||
reason = string.Empty;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenSim.Services.Interfaces
|
||||
{
|
||||
public interface IGatekeeperService
|
||||
{
|
||||
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason);
|
||||
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
|
||||
GridRegion GetHyperlinkRegion(UUID regionID);
|
||||
|
||||
bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
|
||||
|
||||
Reference in New Issue
Block a user