public string LocateUser(UUID userID)
{
Hashtable hash = new Hashtable ();
hash["userID"] = userID.ToString ();
IList paramList = new ArrayList ();
paramList.Add (hash);
XmlRpcRequest request = new XmlRpcRequest ("locate_user", paramList);
string reason = string.Empty;
// Send and get reply
string url = string.Empty;
XmlRpcResponse response = null;
try
{
response = request.Send (m_ServerURL, 10000);
}
catch (Exception e)
{
MainConsole.Instance.DebugFormat ("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
reason = "Exception: " + e.Message;
return url;
}
if (response.IsFault)
{
MainConsole.Instance.ErrorFormat ("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
reason = "XMLRPC Fault";
return url;
}
hash = (Hashtable)response.Value;
//foreach (Object o in hash)
// MainConsole.Instance.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
try
{
if (hash == null)
{
MainConsole.Instance.ErrorFormat ("[USER AGENT CONNECTOR]: LocateUser Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
reason = "Internal error 1";
return url;
}
// Here's the actual response
if (hash.ContainsKey ("URL"))
url = hash["URL"].ToString ();
}
catch (Exception e)
{
MainConsole.Instance.ErrorFormat ("[USER AGENT CONNECTOR]: Got exception on LocateUser response.");
reason = "Exception: " + e.Message;
}
return url;
}