aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs66
1 files changed, 65 insertions, 1 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 46d30df..265bacf 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -470,7 +470,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
470 { 470 {
471 if (hash == null) 471 if (hash == null)
472 { 472 {
473 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); 473 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
474 reason = "Internal error 1"; 474 reason = "Internal error 1";
475 return online; 475 return online;
476 } 476 }
@@ -496,6 +496,70 @@ namespace OpenSim.Services.Connectors.Hypergrid
496 return online; 496 return online;
497 } 497 }
498 498
499 public Dictionary<string, object> GetServerURLs(UUID userID)
500 {
501 Hashtable hash = new Hashtable();
502 hash["userID"] = userID.ToString();
503
504 IList paramList = new ArrayList();
505 paramList.Add(hash);
506
507 XmlRpcRequest request = new XmlRpcRequest("get_server_urls", paramList);
508 string reason = string.Empty;
509
510 // Send and get reply
511 Dictionary<string, object> serverURLs = new Dictionary<string,object>();
512 XmlRpcResponse response = null;
513 try
514 {
515 response = request.Send(m_ServerURL, 10000);
516 }
517 catch (Exception e)
518 {
519 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
520 reason = "Exception: " + e.Message;
521 return serverURLs;
522 }
523
524 if (response.IsFault)
525 {
526 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
527 reason = "XMLRPC Fault";
528 return serverURLs;
529 }
530
531 hash = (Hashtable)response.Value;
532 //foreach (Object o in hash)
533 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
534 try
535 {
536 if (hash == null)
537 {
538 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetServerURLs Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
539 reason = "Internal error 1";
540 return serverURLs;
541 }
542
543 // Here is the actual response
544 foreach (object key in hash.Keys)
545 {
546 if (key is string && ((string)key).StartsWith("SRV_") && hash[key] != null)
547 {
548 string serverType = key.ToString().Substring(4); // remove "SRV_"
549 serverURLs.Add(serverType, hash[key].ToString());
550 }
551 }
552
553 }
554 catch (Exception e)
555 {
556 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
557 reason = "Exception: " + e.Message;
558 }
559
560 return serverURLs;
561 }
562
499 private bool GetBoolResponse(XmlRpcRequest request, out string reason) 563 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
500 { 564 {
501 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); 565 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);