diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 0c55c2e..5b27cf6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -334,6 +334,9 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
334 | UInt32.TryParse((string)hash["http_port"], out p); | 334 | UInt32.TryParse((string)hash["http_port"], out p); |
335 | region.HttpPort = p; | 335 | region.HttpPort = p; |
336 | } | 336 | } |
337 | if (hash.ContainsKey("server_uri") && hash["server_uri"] != null) | ||
338 | region.ServerURI = (string)hash["server_uri"]; | ||
339 | |||
337 | if (hash["internal_port"] != null) | 340 | if (hash["internal_port"] != null) |
338 | { | 341 | { |
339 | int p = 0; | 342 | int p = 0; |
@@ -558,6 +561,60 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
558 | return online; | 561 | return online; |
559 | } | 562 | } |
560 | 563 | ||
564 | public Dictionary<string,object> GetUserInfo (UUID userID) | ||
565 | { | ||
566 | Hashtable hash = new Hashtable(); | ||
567 | hash["userID"] = userID.ToString(); | ||
568 | |||
569 | IList paramList = new ArrayList(); | ||
570 | paramList.Add(hash); | ||
571 | |||
572 | XmlRpcRequest request = new XmlRpcRequest("get_user_info", paramList); | ||
573 | |||
574 | Dictionary<string, object> info = new Dictionary<string, object>(); | ||
575 | XmlRpcResponse response = null; | ||
576 | try | ||
577 | { | ||
578 | response = request.Send(m_ServerURL, 10000); | ||
579 | } | ||
580 | catch | ||
581 | { | ||
582 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUserInfo", m_ServerURL); | ||
583 | return info; | ||
584 | } | ||
585 | |||
586 | if (response.IsFault) | ||
587 | { | ||
588 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString); | ||
589 | return info; | ||
590 | } | ||
591 | |||
592 | hash = (Hashtable)response.Value; | ||
593 | try | ||
594 | { | ||
595 | if (hash == null) | ||
596 | { | ||
597 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUserInfo Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
598 | return info; | ||
599 | } | ||
600 | |||
601 | // Here is the actual response | ||
602 | foreach (object key in hash.Keys) | ||
603 | { | ||
604 | if (hash[key] != null) | ||
605 | { | ||
606 | info.Add(key.ToString(), hash[key]); | ||
607 | } | ||
608 | } | ||
609 | } | ||
610 | catch | ||
611 | { | ||
612 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); | ||
613 | } | ||
614 | |||
615 | return info; | ||
616 | } | ||
617 | |||
561 | public Dictionary<string, object> GetServerURLs(UUID userID) | 618 | public Dictionary<string, object> GetServerURLs(UUID userID) |
562 | { | 619 | { |
563 | Hashtable hash = new Hashtable(); | 620 | Hashtable hash = new Hashtable(); |