diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index ffb026b3f8..181d7f26d1 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -61,9 +61,11 @@ namespace OpenSim.Services.HypergridService protected static IGridUserService m_GridUserService; protected static IGridService m_GridService; - //protected static GatekeeperServiceConnector m_GatekeeperConnector; + protected static GatekeeperServiceConnector m_GatekeeperConnector; protected static IGatekeeperService m_GatekeeperService; + protected static string m_GridName; + protected static bool m_BypassClientVerification; public UserAgentService(IConfigSource config) @@ -90,8 +92,15 @@ namespace OpenSim.Services.HypergridService Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); m_GridUserService = ServerUtils.LoadPlugin(gridUserService, args); - //m_GatekeeperConnector = new GatekeeperServiceConnector(); + m_GatekeeperConnector = new GatekeeperServiceConnector(); m_GatekeeperService = ServerUtils.LoadPlugin(gatekeeperService, args); + + m_GridName = serverConfig.GetString("ExternalName", string.Empty); + if (m_GridName == string.Empty) + { + serverConfig = config.Configs["GatekeeperService"]; + m_GridName = serverConfig.GetString("ExternalName", string.Empty); + } } } @@ -139,7 +148,12 @@ namespace OpenSim.Services.HypergridService TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); - bool success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); + bool success = false; + string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; + if (m_GridName == gridName) + success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); + else + success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); if (!success) {