diff options
Diffstat (limited to 'OpenSim/Services/HypergridService/UserAgentService.cs')
-rw-r--r-- | OpenSim/Services/HypergridService/UserAgentService.cs | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 4bee4b5..181d7f2 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -61,9 +61,11 @@ namespace OpenSim.Services.HypergridService | |||
61 | 61 | ||
62 | protected static IGridUserService m_GridUserService; | 62 | protected static IGridUserService m_GridUserService; |
63 | protected static IGridService m_GridService; | 63 | protected static IGridService m_GridService; |
64 | //protected static GatekeeperServiceConnector m_GatekeeperConnector; | 64 | protected static GatekeeperServiceConnector m_GatekeeperConnector; |
65 | protected static IGatekeeperService m_GatekeeperService; | 65 | protected static IGatekeeperService m_GatekeeperService; |
66 | 66 | ||
67 | protected static string m_GridName; | ||
68 | |||
67 | protected static bool m_BypassClientVerification; | 69 | protected static bool m_BypassClientVerification; |
68 | 70 | ||
69 | public UserAgentService(IConfigSource config) | 71 | public UserAgentService(IConfigSource config) |
@@ -90,8 +92,15 @@ namespace OpenSim.Services.HypergridService | |||
90 | Object[] args = new Object[] { config }; | 92 | Object[] args = new Object[] { config }; |
91 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 93 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
92 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); | 94 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); |
93 | //m_GatekeeperConnector = new GatekeeperServiceConnector(); | 95 | m_GatekeeperConnector = new GatekeeperServiceConnector(); |
94 | m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); | 96 | m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); |
97 | |||
98 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); | ||
99 | if (m_GridName == string.Empty) | ||
100 | { | ||
101 | serverConfig = config.Configs["GatekeeperService"]; | ||
102 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); | ||
103 | } | ||
95 | } | 104 | } |
96 | } | 105 | } |
97 | 106 | ||
@@ -139,7 +148,12 @@ namespace OpenSim.Services.HypergridService | |||
139 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); | 148 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); |
140 | 149 | ||
141 | //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | 150 | //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); |
142 | bool success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); | 151 | bool success = false; |
152 | string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; | ||
153 | if (m_GridName == gridName) | ||
154 | success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); | ||
155 | else | ||
156 | success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | ||
143 | 157 | ||
144 | if (!success) | 158 | if (!success) |
145 | { | 159 | { |
@@ -179,7 +193,7 @@ namespace OpenSim.Services.HypergridService | |||
179 | m_TravelingAgents[agentCircuit.SessionID] = travel; | 193 | m_TravelingAgents[agentCircuit.SessionID] = travel; |
180 | } | 194 | } |
181 | travel.UserID = agentCircuit.AgentID; | 195 | travel.UserID = agentCircuit.AgentID; |
182 | travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort; | 196 | travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; |
183 | travel.ServiceToken = agentCircuit.ServiceSessionID; | 197 | travel.ServiceToken = agentCircuit.ServiceSessionID; |
184 | if (old != null) | 198 | if (old != null) |
185 | travel.ClientToken = old.ClientToken; | 199 | travel.ClientToken = old.ClientToken; |
@@ -215,6 +229,7 @@ namespace OpenSim.Services.HypergridService | |||
215 | return false; | 229 | return false; |
216 | 230 | ||
217 | TravelingAgentInfo travel = m_TravelingAgents[sessionID]; | 231 | TravelingAgentInfo travel = m_TravelingAgents[sessionID]; |
232 | |||
218 | return travel.GridExternalName == thisGridExternalName; | 233 | return travel.GridExternalName == thisGridExternalName; |
219 | } | 234 | } |
220 | 235 | ||