Added ExternalName config on Gatekeeper.

slimupdates
Diva Canto 2010-01-27 08:00:29 -08:00
parent b1b9ac2e74
commit 7c00469cd2
8 changed files with 39 additions and 9 deletions

View File

@ -96,6 +96,12 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
public UUID SessionID; public UUID SessionID;
/// <summary>
/// Hypergrid service token; generated by the user domain, consumed by the receiving grid.
/// There is one such unique token for each grid visited.
/// </summary>
public string ServiceSessionID = string.Empty;
/// <summary> /// <summary>
/// Position the Agent's Avatar starts in the region /// Position the Agent's Avatar starts in the region
/// </summary> /// </summary>
@ -156,6 +162,7 @@ namespace OpenSim.Framework
args["inventory_folder"] = OSD.FromUUID(InventoryFolder); args["inventory_folder"] = OSD.FromUUID(InventoryFolder);
args["secure_session_id"] = OSD.FromUUID(SecureSessionID); args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
args["session_id"] = OSD.FromUUID(SessionID); args["session_id"] = OSD.FromUUID(SessionID);
args["service_session_id"] = OSD.FromString(ServiceSessionID);
args["start_pos"] = OSD.FromString(startpos.ToString()); args["start_pos"] = OSD.FromString(startpos.ToString());
args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
@ -253,6 +260,8 @@ namespace OpenSim.Framework
SecureSessionID = args["secure_session_id"].AsUUID(); SecureSessionID = args["secure_session_id"].AsUUID();
if (args["session_id"] != null) if (args["session_id"] != null)
SessionID = args["session_id"].AsUUID(); SessionID = args["session_id"].AsUUID();
if (args["service_session_id"] != null)
ServiceSessionID = args["service_session_id"].AsString();
if (args["start_pos"] != null) if (args["start_pos"] != null)
Vector3.TryParse(args["start_pos"].AsString(), out startpos); Vector3.TryParse(args["start_pos"].AsString(), out startpos);

View File

@ -157,6 +157,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (security != null) if (security != null)
security.SetEndPoint(sp.ControllingClient.SessionId, sp.ControllingClient.RemoteEndPoint); security.SetEndPoint(sp.ControllingClient.SessionId, sp.ControllingClient.RemoteEndPoint);
//string token = sp.Scene.AuthenticationService.MakeToken(sp.UUID, reg.ExternalHostName + ":" + reg.HttpPort, 30);
// Log them out of this grid // Log them out of this grid
sp.Scene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat); sp.Scene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat);

View File

@ -63,17 +63,19 @@ namespace OpenSim.Server.Handlers.Hypergrid
string name = (string)requestData["region_name"]; string name = (string)requestData["region_name"];
UUID regionID = UUID.Zero; UUID regionID = UUID.Zero;
string externalName = string.Empty;
string imageURL = string.Empty; string imageURL = string.Empty;
ulong regionHandle = 0; ulong regionHandle = 0;
string reason = string.Empty; string reason = string.Empty;
bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out imageURL, out reason); bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason);
Hashtable hash = new Hashtable(); Hashtable hash = new Hashtable();
hash["result"] = success.ToString(); hash["result"] = success.ToString();
hash["uuid"] = regionID.ToString(); hash["uuid"] = regionID.ToString();
hash["handle"] = regionHandle.ToString(); hash["handle"] = regionHandle.ToString();
hash["region_image"] = imageURL; hash["region_image"] = imageURL;
hash["external_name"] = externalName;
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
response.Value = hash; response.Value = hash;

View File

@ -45,11 +45,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
return "/foreignobject/"; 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; regionID = UUID.Zero;
imageURL = string.Empty; imageURL = string.Empty;
realHandle = 0; realHandle = 0;
externalName = string.Empty;
reason = string.Empty; reason = string.Empty;
Hashtable hash = new Hashtable(); Hashtable hash = new Hashtable();
@ -97,9 +98,9 @@ namespace OpenSim.Services.Connectors.Hypergrid
//m_log.Debug(">> HERE, realHandle: " + realHandle); //m_log.Debug(">> HERE, realHandle: " + realHandle);
} }
if (hash["region_image"] != null) if (hash["region_image"] != null)
{
imageURL = (string)hash["region_image"]; imageURL = (string)hash["region_image"];
} if (hash["external_name"] != null)
externalName = (string)hash["external_name"];
} }
} }

View File

@ -214,8 +214,9 @@ namespace OpenSim.Services.GridService
// Finally, link it // Finally, link it
ulong handle = 0; ulong handle = 0;
UUID regionID = UUID.Zero; UUID regionID = UUID.Zero;
string externalName = string.Empty;
string imageURL = 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; return false;
if (regionID != UUID.Zero) if (regionID != UUID.Zero)
@ -229,11 +230,22 @@ namespace OpenSim.Services.GridService
} }
regInfo.RegionID = regionID; 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; regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName;
// Try get the map image // 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 // 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); AddHyperlinkRegion(regInfo, handle);
m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);

View File

@ -59,6 +59,7 @@ namespace OpenSim.Services.HypergridService
UUID m_ScopeID; UUID m_ScopeID;
bool m_AllowTeleportsToAnyRegion; bool m_AllowTeleportsToAnyRegion;
string m_ExternalName;
GridRegion m_DefaultGatewayRegion; GridRegion m_DefaultGatewayRegion;
public GatekeeperService(IConfigSource config, ISimulationService simService) public GatekeeperService(IConfigSource config, ISimulationService simService)
@ -83,6 +84,7 @@ namespace OpenSim.Services.HypergridService
UUID.TryParse(scope, out m_ScopeID); UUID.TryParse(scope, out m_ScopeID);
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
Object[] args = new Object[] { config }; Object[] args = new Object[] { config };
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); 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; regionID = UUID.Zero;
regionHandle = 0; regionHandle = 0;
externalName = m_ExternalName;
imageURL = string.Empty; imageURL = string.Empty;
reason = string.Empty; reason = string.Empty;

View File

@ -36,7 +36,7 @@ namespace OpenSim.Services.Interfaces
{ {
public interface IGatekeeperService 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); GridRegion GetHyperlinkRegion(UUID regionID);
bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);

View File

@ -83,6 +83,8 @@
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
AuthenticationService = "OpenSim.Services.Connectors.dll:AuthenticationServicesConnector" AuthenticationService = "OpenSim.Services.Connectors.dll:AuthenticationServicesConnector"
; how does the outside world reach me? This acts as public key too.
ExternalName = "http://127.0.0.1:9000"
[HGEntityTransferModule] [HGEntityTransferModule]
HomeUsersSecurityService = "OpenSim.Services.HypergridService.dll:HomeUsersSecurityService" HomeUsersSecurityService = "OpenSim.Services.HypergridService.dll:HomeUsersSecurityService"