aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid
diff options
context:
space:
mode:
authorDiva Canto2011-05-25 12:32:21 -0700
committerDiva Canto2011-05-25 12:32:21 -0700
commit5c2168cae758ae19367f4c2f5a02713e74fc0912 (patch)
tree7d189c03a177ca716c91cf903cc7fd2e91fed1dc /OpenSim/Services/Connectors/Hypergrid
parentAdded necessary code to drop inventory on hg friends using the profile window... (diff)
downloadopensim-SC_OLD-5c2168cae758ae19367f4c2f5a02713e74fc0912.zip
opensim-SC_OLD-5c2168cae758ae19367f4c2f5a02713e74fc0912.tar.gz
opensim-SC_OLD-5c2168cae758ae19367f4c2f5a02713e74fc0912.tar.bz2
opensim-SC_OLD-5c2168cae758ae19367f4c2f5a02713e74fc0912.tar.xz
HG: Instant Message working. Tested on HG standalones only. Needs a lot more testing.
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 265bacf..50036b3 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -560,6 +560,64 @@ namespace OpenSim.Services.Connectors.Hypergrid
560 return serverURLs; 560 return serverURLs;
561 } 561 }
562 562
563 public string LocateUser(UUID userID)
564 {
565 Hashtable hash = new Hashtable();
566 hash["userID"] = userID.ToString();
567
568 IList paramList = new ArrayList();
569 paramList.Add(hash);
570
571 XmlRpcRequest request = new XmlRpcRequest("locate_user", paramList);
572 string reason = string.Empty;
573
574 // Send and get reply
575 string url = string.Empty;
576 XmlRpcResponse response = null;
577 try
578 {
579 response = request.Send(m_ServerURL, 10000);
580 }
581 catch (Exception e)
582 {
583 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
584 reason = "Exception: " + e.Message;
585 return url;
586 }
587
588 if (response.IsFault)
589 {
590 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
591 reason = "XMLRPC Fault";
592 return url;
593 }
594
595 hash = (Hashtable)response.Value;
596 //foreach (Object o in hash)
597 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
598 try
599 {
600 if (hash == null)
601 {
602 m_log.ErrorFormat("[USER AGENT CONNECTOR]: LocateUser Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
603 reason = "Internal error 1";
604 return url;
605 }
606
607 // Here's the actual response
608 if (hash.ContainsKey("URL"))
609 url = hash["URL"].ToString();
610
611 }
612 catch (Exception e)
613 {
614 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response.");
615 reason = "Exception: " + e.Message;
616 }
617
618 return url;
619 }
620
563 private bool GetBoolResponse(XmlRpcRequest request, out string reason) 621 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
564 { 622 {
565 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); 623 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);