aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs24
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs27
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs23
3 files changed, 54 insertions, 20 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 42eca05..96d2605 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
358 358
359 private bool GetBoolResponse(XmlRpcRequest request, out string reason) 359 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
360 { 360 {
361 //m_log.Debug("[HGrid]: Linking to " + uri); 361 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);
362 XmlRpcResponse response = null; 362 XmlRpcResponse response = null;
363 try 363 try
364 { 364 {
@@ -366,14 +366,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
366 } 366 }
367 catch (Exception e) 367 catch (Exception e)
368 { 368 {
369 m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server "); 369 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
370 reason = "Exception: " + e.Message; 370 reason = "Exception: " + e.Message;
371 return false; 371 return false;
372 } 372 }
373 373
374 if (response.IsFault) 374 if (response.IsFault)
375 { 375 {
376 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString); 376 m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
377 reason = "XMLRPC Fault"; 377 reason = "XMLRPC Fault";
378 return false; 378 return false;
379 } 379 }
@@ -383,15 +383,29 @@ namespace OpenSim.Services.Connectors.Hypergrid
383 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); 383 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
384 try 384 try
385 { 385 {
386 if (hash == null)
387 {
388 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
389 reason = "Internal error 1";
390 return false;
391 }
386 bool success = false; 392 bool success = false;
387 reason = string.Empty; 393 reason = string.Empty;
388 Boolean.TryParse((string)hash["result"], out success); 394 if (hash.ContainsKey("result"))
395 Boolean.TryParse((string)hash["result"], out success);
396 else
397 {
398 reason = "Internal error 2";
399 m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL);
400 }
389 401
390 return success; 402 return success;
391 } 403 }
392 catch (Exception e) 404 catch (Exception e)
393 { 405 {
394 m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace); 406 m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response.");
407 if (hash.ContainsKey("result") && hash["result"] != null)
408 m_log.ErrorFormat("Reply was ", (string)hash["result"]);
395 reason = "Exception: " + e.Message; 409 reason = "Exception: " + e.Message;
396 return false; 410 return false;
397 } 411 }
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 3fc9327..3aaafe8 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Services.HypergridService
73 throw new Exception(String.Format("No section GatekeeperService in config file")); 73 throw new Exception(String.Format("No section GatekeeperService in config file"));
74 74
75 string accountService = serverConfig.GetString("UserAccountService", String.Empty); 75 string accountService = serverConfig.GetString("UserAccountService", String.Empty);
76 string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); 76 string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty);
77 string gridService = serverConfig.GetString("GridService", String.Empty); 77 string gridService = serverConfig.GetString("GridService", String.Empty);
78 string presenceService = serverConfig.GetString("PresenceService", String.Empty); 78 string presenceService = serverConfig.GetString("PresenceService", String.Empty);
79 string simulationService = serverConfig.GetString("SimulationService", String.Empty); 79 string simulationService = serverConfig.GetString("SimulationService", String.Empty);
@@ -283,18 +283,23 @@ namespace OpenSim.Services.HypergridService
283 return false; 283 return false;
284 } 284 }
285 285
286 Object[] args = new Object[] { userURL }; 286 if (userURL == m_ExternalName)
287 IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin<IUserAgentService>(m_AuthDll, args); 287 return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
288 if (userAgentService != null) 288 else
289 { 289 {
290 try 290 Object[] args = new Object[] { userURL };
291 IUserAgentService userAgentService = new UserAgentServiceConnector(userURL);
292 if (userAgentService != null)
291 { 293 {
292 return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); 294 try
293 } 295 {
294 catch 296 return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
295 { 297 }
296 m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); 298 catch
297 return false; 299 {
300 m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
301 return false;
302 }
298 } 303 }
299 } 304 }
300 305
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