aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
diff options
context:
space:
mode:
authorDiva Canto2012-03-17 21:27:28 -0700
committerDiva Canto2012-03-17 21:27:28 -0700
commitd1256536b500a0d72eb643635d10c65980ea2588 (patch)
treeb378a299d970fa5f3266a59f32baa607fee3006b /OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
parentAmend to previous commit: normalize strings ToLower. (diff)
downloadopensim-SC-d1256536b500a0d72eb643635d10c65980ea2588.zip
opensim-SC-d1256536b500a0d72eb643635d10c65980ea2588.tar.gz
opensim-SC-d1256536b500a0d72eb643635d10c65980ea2588.tar.bz2
opensim-SC-d1256536b500a0d72eb643635d10c65980ea2588.tar.xz
Added GetUUID(first, last) on UserAgentsService so that we can finally make direct user connections.
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs61
1 files changed, 60 insertions, 1 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 5b27cf6..bf86035 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -789,13 +789,72 @@ namespace OpenSim.Services.Connectors.Hypergrid
789 } 789 }
790 catch 790 catch
791 { 791 {
792 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response."); 792 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetUUI response.");
793// reason = "Exception: " + e.Message; 793// reason = "Exception: " + e.Message;
794 } 794 }
795 795
796 return uui; 796 return uui;
797 } 797 }
798 798
799 public UUID GetUUID(String first, String last)
800 {
801 Hashtable hash = new Hashtable();
802 hash["first"] = first;
803 hash["last"] = last;
804
805 IList paramList = new ArrayList();
806 paramList.Add(hash);
807
808 XmlRpcRequest request = new XmlRpcRequest("get_uuid", paramList);
809 // string reason = string.Empty;
810
811 // Send and get reply
812 UUID uuid = UUID.Zero;
813 XmlRpcResponse response = null;
814 try
815 {
816 response = request.Send(m_ServerURL, 10000);
817 }
818 catch
819 {
820 m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUUID", m_ServerURL);
821 // reason = "Exception: " + e.Message;
822 return uuid;
823 }
824
825 if (response.IsFault)
826 {
827 m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetUUID returned an error: {1}", m_ServerURL, response.FaultString);
828 // reason = "XMLRPC Fault";
829 return uuid;
830 }
831
832 hash = (Hashtable)response.Value;
833 //foreach (Object o in hash)
834 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
835 try
836 {
837 if (hash == null)
838 {
839 m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUUDI Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
840 // reason = "Internal error 1";
841 return uuid;
842 }
843
844 // Here's the actual response
845 if (hash.ContainsKey("UUID"))
846 UUID.TryParse(hash["UUID"].ToString(), out uuid);
847
848 }
849 catch
850 {
851 m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on UUID response.");
852 // reason = "Exception: " + e.Message;
853 }
854
855 return uuid;
856 }
857
799 private bool GetBoolResponse(XmlRpcRequest request, out string reason) 858 private bool GetBoolResponse(XmlRpcRequest request, out string reason)
800 { 859 {
801 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); 860 //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);