diff options
author | Justin Clark-Casey (justincc) | 2014-02-14 00:16:17 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-02-14 00:16:17 +0000 |
commit | ffd0da23fb9041df730438a614161a5e3dbc2846 (patch) | |
tree | fc2bc9b58cf0f829ee7b81068cd59646b8ecfc67 | |
parent | Merge branch 'justincc-master' (diff) | |
parent | Change warns associated with UserAgentServiceConnector to debugs, as this is ... (diff) | |
download | opensim-SC-ffd0da23fb9041df730438a614161a5e3dbc2846.zip opensim-SC-ffd0da23fb9041df730438a614161a5e3dbc2846.tar.gz opensim-SC-ffd0da23fb9041df730438a614161a5e3dbc2846.tar.bz2 opensim-SC-ffd0da23fb9041df730438a614161a5e3dbc2846.tar.xz |
Merge branch 'justincc-master'
8 files changed, 193 insertions, 312 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index 7bf19c2..c51b30f 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | |||
@@ -282,7 +282,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
282 | string uasURL = circuit.ServiceURLs["HomeURI"].ToString(); | 282 | string uasURL = circuit.ServiceURLs["HomeURI"].ToString(); |
283 | m_log.DebugFormat("[HG MESSAGE TRANSFER]: getting UUI of user {0} from {1}", toAgent, uasURL); | 283 | m_log.DebugFormat("[HG MESSAGE TRANSFER]: getting UUI of user {0} from {1}", toAgent, uasURL); |
284 | UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uasURL); | 284 | UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uasURL); |
285 | return uasConn.GetUUI(fromAgent, toAgent); | 285 | |
286 | string agentUUI = string.Empty; | ||
287 | try | ||
288 | { | ||
289 | agentUUI = uasConn.GetUUI(fromAgent, toAgent); | ||
290 | } | ||
291 | catch (Exception e) { | ||
292 | m_log.Debug("[HG MESSAGE TRANSFER]: GetUUI call failed ", e); | ||
293 | } | ||
294 | |||
295 | return agentUUI; | ||
286 | } | 296 | } |
287 | } | 297 | } |
288 | } | 298 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 2da0a74..f3e757a 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -1164,7 +1164,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1164 | 1164 | ||
1165 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url); | 1165 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url); |
1166 | 1166 | ||
1167 | Dictionary<string, object> account = uConn.GetUserInfo(userID); | 1167 | Dictionary<string, object> account; |
1168 | try | ||
1169 | { | ||
1170 | account = uConn.GetUserInfo(userID); | ||
1171 | } | ||
1172 | catch (Exception e) | ||
1173 | { | ||
1174 | m_log.Debug("[PROFILES]: GetUserInfo call failed ", e); | ||
1175 | account = new Dictionary<string, object>(); | ||
1176 | } | ||
1168 | 1177 | ||
1169 | if (account.Count > 0) | 1178 | if (account.Count > 0) |
1170 | { | 1179 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 09b1975..e354522 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -462,7 +462,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
462 | 462 | ||
463 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); | 463 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); |
464 | Vector3 position = Vector3.UnitY, lookAt = Vector3.UnitY; | 464 | Vector3 position = Vector3.UnitY, lookAt = Vector3.UnitY; |
465 | GridRegion finalDestination = userAgentService.GetHomeRegion(aCircuit.AgentID, out position, out lookAt); | 465 | |
466 | GridRegion finalDestination = null; | ||
467 | try | ||
468 | { | ||
469 | finalDestination = userAgentService.GetHomeRegion(aCircuit.AgentID, out position, out lookAt); | ||
470 | } | ||
471 | catch (Exception e) | ||
472 | { | ||
473 | m_log.Debug("[HG ENTITY TRANSFER MODULE]: GetHomeRegion call failed ", e); | ||
474 | } | ||
475 | |||
466 | if (finalDestination == null) | 476 | if (finalDestination == null) |
467 | { | 477 | { |
468 | client.SendTeleportFailed("Your home region could not be found"); | 478 | client.SendTeleportFailed("Your home region could not be found"); |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs index 245c808..7b89c2c 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs | |||
@@ -130,7 +130,17 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
130 | } | 130 | } |
131 | 131 | ||
132 | UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr); | 132 | UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr); |
133 | UUID userID = uasConn.GetUUID(names[0], names[1]); | 133 | |
134 | UUID userID = UUID.Zero; | ||
135 | try | ||
136 | { | ||
137 | userID = uasConn.GetUUID(names[0], names[1]); | ||
138 | } | ||
139 | catch (Exception e) | ||
140 | { | ||
141 | m_log.Debug("[USER MANAGEMENT MODULE]: GetUUID call failed ", e); | ||
142 | } | ||
143 | |||
134 | if (!userID.Equals(UUID.Zero)) | 144 | if (!userID.Equals(UUID.Zero)) |
135 | { | 145 | { |
136 | UserData ud = new UserData(); | 146 | UserData ud = new UserData(); |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 3fb5195..9f0a719 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -473,7 +473,16 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
473 | // serverType, userdata.HomeURL, userID); | 473 | // serverType, userdata.HomeURL, userID); |
474 | 474 | ||
475 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL); | 475 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL); |
476 | userdata.ServerURLs = uConn.GetServerURLs(userID); | 476 | try |
477 | { | ||
478 | userdata.ServerURLs = uConn.GetServerURLs(userID); | ||
479 | } | ||
480 | catch (Exception e) | ||
481 | { | ||
482 | m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e); | ||
483 | userdata.ServerURLs = new Dictionary<string, object>(); | ||
484 | } | ||
485 | |||
477 | if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) | 486 | if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) |
478 | return userdata.ServerURLs[serverType].ToString(); | 487 | return userdata.ServerURLs[serverType].ToString(); |
479 | } | 488 | } |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 20397a1..f869060 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -78,7 +78,8 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
78 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); | 78 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL); | 81 | |
82 | //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL); | ||
82 | } | 83 | } |
83 | 84 | ||
84 | public UserAgentServiceConnector(IConfigSource config) | 85 | public UserAgentServiceConnector(IConfigSource config) |
@@ -190,108 +191,99 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
190 | // no-op | 191 | // no-op |
191 | } | 192 | } |
192 | 193 | ||
193 | public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) | 194 | private Hashtable CallServer(string methodName, Hashtable hash) |
194 | { | 195 | { |
195 | position = Vector3.UnitY; lookAt = Vector3.UnitY; | ||
196 | |||
197 | Hashtable hash = new Hashtable(); | ||
198 | hash["userID"] = userID.ToString(); | ||
199 | |||
200 | IList paramList = new ArrayList(); | 196 | IList paramList = new ArrayList(); |
201 | paramList.Add(hash); | 197 | paramList.Add(hash); |
202 | 198 | ||
203 | XmlRpcRequest request = new XmlRpcRequest("get_home_region", paramList); | 199 | XmlRpcRequest request = new XmlRpcRequest(methodName, paramList); |
200 | |||
201 | // Send and get reply | ||
204 | XmlRpcResponse response = null; | 202 | XmlRpcResponse response = null; |
205 | try | 203 | try |
206 | { | 204 | { |
207 | response = request.Send(m_ServerURL, 10000); | 205 | response = request.Send(m_ServerURL, 10000); |
208 | } | 206 | } |
209 | catch (Exception) | 207 | catch (Exception e) |
210 | { | 208 | { |
211 | return null; | 209 | m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURL, e.Message); |
210 | throw; | ||
212 | } | 211 | } |
213 | 212 | ||
214 | if (response.IsFault) | 213 | if (response.IsFault) |
215 | { | 214 | { |
216 | return null; | 215 | throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURL, response.FaultString)); |
217 | } | 216 | } |
218 | 217 | ||
219 | hash = (Hashtable)response.Value; | 218 | hash = (Hashtable)response.Value; |
220 | //foreach (Object o in hash) | 219 | |
221 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | 220 | if (hash == null) |
222 | try | ||
223 | { | 221 | { |
224 | bool success = false; | 222 | throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURL)); |
225 | Boolean.TryParse((string)hash["result"], out success); | 223 | } |
226 | if (success) | ||
227 | { | ||
228 | GridRegion region = new GridRegion(); | ||
229 | 224 | ||
230 | UUID.TryParse((string)hash["uuid"], out region.RegionID); | 225 | return hash; |
231 | //m_log.Debug(">> HERE, uuid: " + region.RegionID); | 226 | } |
232 | int n = 0; | ||
233 | if (hash["x"] != null) | ||
234 | { | ||
235 | Int32.TryParse((string)hash["x"], out n); | ||
236 | region.RegionLocX = n; | ||
237 | //m_log.Debug(">> HERE, x: " + region.RegionLocX); | ||
238 | } | ||
239 | if (hash["y"] != null) | ||
240 | { | ||
241 | Int32.TryParse((string)hash["y"], out n); | ||
242 | region.RegionLocY = n; | ||
243 | //m_log.Debug(">> HERE, y: " + region.RegionLocY); | ||
244 | } | ||
245 | if (hash["size_x"] != null) | ||
246 | { | ||
247 | Int32.TryParse((string)hash["size_x"], out n); | ||
248 | region.RegionSizeX = n; | ||
249 | //m_log.Debug(">> HERE, x: " + region.RegionLocX); | ||
250 | } | ||
251 | if (hash["size_y"] != null) | ||
252 | { | ||
253 | Int32.TryParse((string)hash["size_y"], out n); | ||
254 | region.RegionSizeY = n; | ||
255 | //m_log.Debug(">> HERE, y: " + region.RegionLocY); | ||
256 | } | ||
257 | if (hash["region_name"] != null) | ||
258 | { | ||
259 | region.RegionName = (string)hash["region_name"]; | ||
260 | //m_log.Debug(">> HERE, name: " + region.RegionName); | ||
261 | } | ||
262 | if (hash["hostname"] != null) | ||
263 | region.ExternalHostName = (string)hash["hostname"]; | ||
264 | if (hash["http_port"] != null) | ||
265 | { | ||
266 | uint p = 0; | ||
267 | UInt32.TryParse((string)hash["http_port"], out p); | ||
268 | region.HttpPort = p; | ||
269 | } | ||
270 | if (hash.ContainsKey("server_uri") && hash["server_uri"] != null) | ||
271 | region.ServerURI = (string)hash["server_uri"]; | ||
272 | 227 | ||
273 | if (hash["internal_port"] != null) | 228 | public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) |
274 | { | 229 | { |
275 | int p = 0; | 230 | position = Vector3.UnitY; lookAt = Vector3.UnitY; |
276 | Int32.TryParse((string)hash["internal_port"], out p); | ||
277 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); | ||
278 | } | ||
279 | if (hash["position"] != null) | ||
280 | Vector3.TryParse((string)hash["position"], out position); | ||
281 | if (hash["lookAt"] != null) | ||
282 | Vector3.TryParse((string)hash["lookAt"], out lookAt); | ||
283 | 231 | ||
284 | // Successful return | 232 | Hashtable hash = new Hashtable(); |
285 | return region; | 233 | hash["userID"] = userID.ToString(); |
286 | } | 234 | |
235 | hash = CallServer("get_home_region", hash); | ||
287 | 236 | ||
237 | bool success; | ||
238 | if (!Boolean.TryParse((string)hash["result"], out success) || !success) | ||
239 | return null; | ||
240 | |||
241 | GridRegion region = new GridRegion(); | ||
242 | |||
243 | UUID.TryParse((string)hash["uuid"], out region.RegionID); | ||
244 | //m_log.Debug(">> HERE, uuid: " + region.RegionID); | ||
245 | int n = 0; | ||
246 | if (hash["x"] != null) | ||
247 | { | ||
248 | Int32.TryParse((string)hash["x"], out n); | ||
249 | region.RegionLocX = n; | ||
250 | //m_log.Debug(">> HERE, x: " + region.RegionLocX); | ||
288 | } | 251 | } |
289 | catch (Exception) | 252 | if (hash["y"] != null) |
290 | { | 253 | { |
291 | return null; | 254 | Int32.TryParse((string)hash["y"], out n); |
255 | region.RegionLocY = n; | ||
256 | //m_log.Debug(">> HERE, y: " + region.RegionLocY); | ||
292 | } | 257 | } |
258 | if (hash["region_name"] != null) | ||
259 | { | ||
260 | region.RegionName = (string)hash["region_name"]; | ||
261 | //m_log.Debug(">> HERE, name: " + region.RegionName); | ||
262 | } | ||
263 | if (hash["hostname"] != null) | ||
264 | region.ExternalHostName = (string)hash["hostname"]; | ||
265 | if (hash["http_port"] != null) | ||
266 | { | ||
267 | uint p = 0; | ||
268 | UInt32.TryParse((string)hash["http_port"], out p); | ||
269 | region.HttpPort = p; | ||
270 | } | ||
271 | if (hash.ContainsKey("server_uri") && hash["server_uri"] != null) | ||
272 | region.ServerURI = (string)hash["server_uri"]; | ||
273 | |||
274 | if (hash["internal_port"] != null) | ||
275 | { | ||
276 | int p = 0; | ||
277 | Int32.TryParse((string)hash["internal_port"], out p); | ||
278 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); | ||
279 | } | ||
280 | if (hash["position"] != null) | ||
281 | Vector3.TryParse((string)hash["position"], out position); | ||
282 | if (hash["lookAt"] != null) | ||
283 | Vector3.TryParse((string)hash["lookAt"], out lookAt); | ||
293 | 284 | ||
294 | return null; | 285 | // Successful return |
286 | return region; | ||
295 | } | 287 | } |
296 | 288 | ||
297 | public bool IsAgentComingHome(UUID sessionID, string thisGridExternalName) | 289 | public bool IsAgentComingHome(UUID sessionID, string thisGridExternalName) |
@@ -500,50 +492,16 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
500 | Hashtable hash = new Hashtable(); | 492 | Hashtable hash = new Hashtable(); |
501 | hash["userID"] = userID.ToString(); | 493 | hash["userID"] = userID.ToString(); |
502 | 494 | ||
503 | IList paramList = new ArrayList(); | 495 | hash = CallServer("get_user_info", hash); |
504 | paramList.Add(hash); | ||
505 | |||
506 | XmlRpcRequest request = new XmlRpcRequest("get_user_info", paramList); | ||
507 | 496 | ||
508 | Dictionary<string, object> info = new Dictionary<string, object>(); | 497 | Dictionary<string, object> info = new Dictionary<string, object>(); |
509 | XmlRpcResponse response = null; | ||
510 | try | ||
511 | { | ||
512 | response = request.Send(m_ServerURL, 10000); | ||
513 | } | ||
514 | catch | ||
515 | { | ||
516 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUserInfo", m_ServerURL); | ||
517 | return info; | ||
518 | } | ||
519 | 498 | ||
520 | if (response.IsFault) | 499 | foreach (object key in hash.Keys) |
521 | { | 500 | { |
522 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString); | 501 | if (hash[key] != null) |
523 | return info; | ||
524 | } | ||
525 | |||
526 | hash = (Hashtable)response.Value; | ||
527 | try | ||
528 | { | ||
529 | if (hash == null) | ||
530 | { | 502 | { |
531 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUserInfo Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | 503 | info.Add(key.ToString(), hash[key]); |
532 | return info; | ||
533 | } | 504 | } |
534 | |||
535 | // Here is the actual response | ||
536 | foreach (object key in hash.Keys) | ||
537 | { | ||
538 | if (hash[key] != null) | ||
539 | { | ||
540 | info.Add(key.ToString(), hash[key]); | ||
541 | } | ||
542 | } | ||
543 | } | ||
544 | catch | ||
545 | { | ||
546 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); | ||
547 | } | 505 | } |
548 | 506 | ||
549 | return info; | 507 | return info; |
@@ -554,60 +512,16 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
554 | Hashtable hash = new Hashtable(); | 512 | Hashtable hash = new Hashtable(); |
555 | hash["userID"] = userID.ToString(); | 513 | hash["userID"] = userID.ToString(); |
556 | 514 | ||
557 | IList paramList = new ArrayList(); | 515 | hash = CallServer("get_server_urls", hash); |
558 | paramList.Add(hash); | 516 | |
559 | 517 | Dictionary<string, object> serverURLs = new Dictionary<string, object>(); | |
560 | XmlRpcRequest request = new XmlRpcRequest("get_server_urls", paramList); | 518 | foreach (object key in hash.Keys) |
561 | // string reason = string.Empty; | ||
562 | |||
563 | // Send and get reply | ||
564 | Dictionary<string, object> serverURLs = new Dictionary<string,object>(); | ||
565 | XmlRpcResponse response = null; | ||
566 | try | ||
567 | { | 519 | { |
568 | response = request.Send(m_ServerURL, 10000); | 520 | if (key is string && ((string)key).StartsWith("SRV_") && hash[key] != null) |
569 | } | ||
570 | catch | ||
571 | { | ||
572 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetServerURLs for user {1}", m_ServerURL, userID); | ||
573 | // reason = "Exception: " + e.Message; | ||
574 | return serverURLs; | ||
575 | } | ||
576 | |||
577 | if (response.IsFault) | ||
578 | { | ||
579 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString); | ||
580 | // reason = "XMLRPC Fault"; | ||
581 | return serverURLs; | ||
582 | } | ||
583 | |||
584 | hash = (Hashtable)response.Value; | ||
585 | //foreach (Object o in hash) | ||
586 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | ||
587 | try | ||
588 | { | ||
589 | if (hash == null) | ||
590 | { | ||
591 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetServerURLs Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
592 | // reason = "Internal error 1"; | ||
593 | return serverURLs; | ||
594 | } | ||
595 | |||
596 | // Here is the actual response | ||
597 | foreach (object key in hash.Keys) | ||
598 | { | 521 | { |
599 | if (key is string && ((string)key).StartsWith("SRV_") && hash[key] != null) | 522 | string serverType = key.ToString().Substring(4); // remove "SRV_" |
600 | { | 523 | serverURLs.Add(serverType, hash[key].ToString()); |
601 | string serverType = key.ToString().Substring(4); // remove "SRV_" | ||
602 | serverURLs.Add(serverType, hash[key].ToString()); | ||
603 | } | ||
604 | } | 524 | } |
605 | |||
606 | } | ||
607 | catch | ||
608 | { | ||
609 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); | ||
610 | // reason = "Exception: " + e.Message; | ||
611 | } | 525 | } |
612 | 526 | ||
613 | return serverURLs; | 527 | return serverURLs; |
@@ -618,55 +532,13 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
618 | Hashtable hash = new Hashtable(); | 532 | Hashtable hash = new Hashtable(); |
619 | hash["userID"] = userID.ToString(); | 533 | hash["userID"] = userID.ToString(); |
620 | 534 | ||
621 | IList paramList = new ArrayList(); | 535 | hash = CallServer("locate_user", hash); |
622 | paramList.Add(hash); | ||
623 | |||
624 | XmlRpcRequest request = new XmlRpcRequest("locate_user", paramList); | ||
625 | // string reason = string.Empty; | ||
626 | 536 | ||
627 | // Send and get reply | ||
628 | string url = string.Empty; | 537 | string url = string.Empty; |
629 | XmlRpcResponse response = null; | ||
630 | try | ||
631 | { | ||
632 | response = request.Send(m_ServerURL, 10000); | ||
633 | } | ||
634 | catch | ||
635 | { | ||
636 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for LocateUser", m_ServerURL); | ||
637 | // reason = "Exception: " + e.Message; | ||
638 | return url; | ||
639 | } | ||
640 | 538 | ||
641 | if (response.IsFault) | 539 | // Here's the actual response |
642 | { | 540 | if (hash.ContainsKey("URL")) |
643 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for LocateUser returned an error: {1}", m_ServerURL, response.FaultString); | 541 | url = hash["URL"].ToString(); |
644 | // reason = "XMLRPC Fault"; | ||
645 | return url; | ||
646 | } | ||
647 | |||
648 | hash = (Hashtable)response.Value; | ||
649 | //foreach (Object o in hash) | ||
650 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | ||
651 | try | ||
652 | { | ||
653 | if (hash == null) | ||
654 | { | ||
655 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: LocateUser Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
656 | // reason = "Internal error 1"; | ||
657 | return url; | ||
658 | } | ||
659 | |||
660 | // Here's the actual response | ||
661 | if (hash.ContainsKey("URL")) | ||
662 | url = hash["URL"].ToString(); | ||
663 | |||
664 | } | ||
665 | catch | ||
666 | { | ||
667 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response."); | ||
668 | // reason = "Exception: " + e.Message; | ||
669 | } | ||
670 | 542 | ||
671 | return url; | 543 | return url; |
672 | } | 544 | } |
@@ -677,55 +549,13 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
677 | hash["userID"] = userID.ToString(); | 549 | hash["userID"] = userID.ToString(); |
678 | hash["targetUserID"] = targetUserID.ToString(); | 550 | hash["targetUserID"] = targetUserID.ToString(); |
679 | 551 | ||
680 | IList paramList = new ArrayList(); | 552 | hash = CallServer("get_uui", hash); |
681 | paramList.Add(hash); | ||
682 | |||
683 | XmlRpcRequest request = new XmlRpcRequest("get_uui", paramList); | ||
684 | // string reason = string.Empty; | ||
685 | 553 | ||
686 | // Send and get reply | ||
687 | string uui = string.Empty; | 554 | string uui = string.Empty; |
688 | XmlRpcResponse response = null; | ||
689 | try | ||
690 | { | ||
691 | response = request.Send(m_ServerURL, 10000); | ||
692 | } | ||
693 | catch | ||
694 | { | ||
695 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUUI", m_ServerURL); | ||
696 | // reason = "Exception: " + e.Message; | ||
697 | return uui; | ||
698 | } | ||
699 | 555 | ||
700 | if (response.IsFault) | 556 | // Here's the actual response |
701 | { | 557 | if (hash.ContainsKey("UUI")) |
702 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetUUI returned an error: {1}", m_ServerURL, response.FaultString); | 558 | uui = hash["UUI"].ToString(); |
703 | // reason = "XMLRPC Fault"; | ||
704 | return uui; | ||
705 | } | ||
706 | |||
707 | hash = (Hashtable)response.Value; | ||
708 | //foreach (Object o in hash) | ||
709 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | ||
710 | try | ||
711 | { | ||
712 | if (hash == null) | ||
713 | { | ||
714 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUUI Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
715 | // reason = "Internal error 1"; | ||
716 | return uui; | ||
717 | } | ||
718 | |||
719 | // Here's the actual response | ||
720 | if (hash.ContainsKey("UUI")) | ||
721 | uui = hash["UUI"].ToString(); | ||
722 | |||
723 | } | ||
724 | catch | ||
725 | { | ||
726 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetUUI response."); | ||
727 | // reason = "Exception: " + e.Message; | ||
728 | } | ||
729 | 559 | ||
730 | return uui; | 560 | return uui; |
731 | } | 561 | } |
@@ -736,54 +566,17 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
736 | hash["first"] = first; | 566 | hash["first"] = first; |
737 | hash["last"] = last; | 567 | hash["last"] = last; |
738 | 568 | ||
739 | IList paramList = new ArrayList(); | 569 | hash = CallServer("get_uuid", hash); |
740 | paramList.Add(hash); | ||
741 | |||
742 | XmlRpcRequest request = new XmlRpcRequest("get_uuid", paramList); | ||
743 | // string reason = string.Empty; | ||
744 | 570 | ||
745 | // Send and get reply | 571 | if (!hash.ContainsKey("UUID")) |
746 | UUID uuid = UUID.Zero; | ||
747 | XmlRpcResponse response = null; | ||
748 | try | ||
749 | { | 572 | { |
750 | response = request.Send(m_ServerURL, 10000); | 573 | throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURL)); |
751 | } | ||
752 | catch | ||
753 | { | ||
754 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUUID", m_ServerURL); | ||
755 | // reason = "Exception: " + e.Message; | ||
756 | return uuid; | ||
757 | } | 574 | } |
758 | 575 | ||
759 | if (response.IsFault) | 576 | UUID uuid; |
760 | { | 577 | if (!UUID.TryParse(hash["UUID"].ToString(), out uuid)) |
761 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetUUID returned an error: {1}", m_ServerURL, response.FaultString); | ||
762 | // reason = "XMLRPC Fault"; | ||
763 | return uuid; | ||
764 | } | ||
765 | |||
766 | hash = (Hashtable)response.Value; | ||
767 | //foreach (Object o in hash) | ||
768 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | ||
769 | try | ||
770 | { | ||
771 | if (hash == null) | ||
772 | { | ||
773 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUUDI Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
774 | // reason = "Internal error 1"; | ||
775 | return uuid; | ||
776 | } | ||
777 | |||
778 | // Here's the actual response | ||
779 | if (hash.ContainsKey("UUID")) | ||
780 | UUID.TryParse(hash["UUID"].ToString(), out uuid); | ||
781 | |||
782 | } | ||
783 | catch | ||
784 | { | 578 | { |
785 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on UUID response."); | 579 | throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURL, hash["UUID"].ToString())); |
786 | // reason = "Exception: " + e.Message; | ||
787 | } | 580 | } |
788 | 581 | ||
789 | return uuid; | 582 | return uuid; |
diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index e8d7cca..9b7b278 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs | |||
@@ -215,7 +215,15 @@ namespace OpenSim.Services.HypergridService | |||
215 | { | 215 | { |
216 | // Let's check with the UAS if the user is elsewhere | 216 | // Let's check with the UAS if the user is elsewhere |
217 | m_log.DebugFormat("[HG IM SERVICE]: User is not present. Checking location with User Agent service"); | 217 | m_log.DebugFormat("[HG IM SERVICE]: User is not present. Checking location with User Agent service"); |
218 | url = m_UserAgentService.LocateUser(toAgentID); | 218 | try |
219 | { | ||
220 | url = m_UserAgentService.LocateUser(toAgentID); | ||
221 | } | ||
222 | catch (Exception e) | ||
223 | { | ||
224 | m_log.Warn("[HG IM SERVICE]: LocateUser call failed ", e); | ||
225 | url = string.Empty; | ||
226 | } | ||
219 | } | 227 | } |
220 | 228 | ||
221 | // check if we've tried this before.. | 229 | // check if we've tried this before.. |
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index 05e175a..bece4c7 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -47,15 +47,47 @@ namespace OpenSim.Services.Interfaces | |||
47 | { | 47 | { |
48 | bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason); | 48 | bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason); |
49 | void LogoutAgent(UUID userID, UUID sessionID); | 49 | void LogoutAgent(UUID userID, UUID sessionID); |
50 | |||
51 | /// <summary> | ||
52 | /// Returns the home region of a remote user. | ||
53 | /// </summary> | ||
54 | /// <returns>On success: the user's home region. If the user doesn't exist: null.</returns> | ||
55 | /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks> | ||
50 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); | 56 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); |
57 | |||
58 | /// <summary> | ||
59 | /// Returns the Server URLs of a remote user. | ||
60 | /// </summary> | ||
61 | /// <returns>On success: the user's Server URLs. If the user doesn't exist: an empty dictionary.</returns> | ||
62 | /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks> | ||
51 | Dictionary<string, object> GetServerURLs(UUID userID); | 63 | Dictionary<string, object> GetServerURLs(UUID userID); |
52 | Dictionary<string,object> GetUserInfo(UUID userID); | ||
53 | 64 | ||
65 | /// <summary> | ||
66 | /// Returns the UserInfo of a remote user. | ||
67 | /// </summary> | ||
68 | /// <returns>On success: the user's UserInfo. If the user doesn't exist: an empty dictionary.</returns> | ||
69 | /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks> | ||
70 | Dictionary<string, object> GetUserInfo(UUID userID); | ||
71 | |||
72 | /// <summary> | ||
73 | /// Returns the current location of a remote user. | ||
74 | /// </summary> | ||
75 | /// <returns>On success: the user's Server URLs. If the user doesn't exist: "".</returns> | ||
76 | /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks> | ||
54 | string LocateUser(UUID userID); | 77 | string LocateUser(UUID userID); |
55 | // Tries to get the universal user identifier for the targetUserId | 78 | |
56 | // on behalf of the userID | 79 | /// <summary> |
80 | /// Returns the Universal User Identifier for 'targetUserID' on behalf of 'userID'. | ||
81 | /// </summary> | ||
82 | /// <returns>On success: the user's UUI. If the user doesn't exist: "".</returns> | ||
83 | /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks> | ||
57 | string GetUUI(UUID userID, UUID targetUserID); | 84 | string GetUUI(UUID userID, UUID targetUserID); |
58 | 85 | ||
86 | /// <summary> | ||
87 | /// Returns the remote user that has the given name. | ||
88 | /// </summary> | ||
89 | /// <returns>On success: the user's UUID. If the user doesn't exist: UUID.Zero.</returns> | ||
90 | /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks> | ||
59 | UUID GetUUID(String first, String last); | 91 | UUID GetUUID(String first, String last); |
60 | 92 | ||
61 | // Returns the local friends online | 93 | // Returns the local friends online |