diff options
Diffstat (limited to 'OpenSim/Services')
3 files changed, 80 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index a73bf9e..d617aee 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -559,6 +559,60 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
559 | return online; | 559 | return online; |
560 | } | 560 | } |
561 | 561 | ||
562 | public Dictionary<string,object> GetUserInfo (UUID userID) | ||
563 | { | ||
564 | Hashtable hash = new Hashtable(); | ||
565 | hash["userID"] = userID.ToString(); | ||
566 | |||
567 | IList paramList = new ArrayList(); | ||
568 | paramList.Add(hash); | ||
569 | |||
570 | XmlRpcRequest request = new XmlRpcRequest("get_user_info", paramList); | ||
571 | |||
572 | Dictionary<string, object> info = new Dictionary<string, object>(); | ||
573 | XmlRpcResponse response = null; | ||
574 | try | ||
575 | { | ||
576 | response = request.Send(m_ServerURL, 10000); | ||
577 | } | ||
578 | catch | ||
579 | { | ||
580 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUserInfo", m_ServerURL); | ||
581 | return info; | ||
582 | } | ||
583 | |||
584 | if (response.IsFault) | ||
585 | { | ||
586 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString); | ||
587 | return info; | ||
588 | } | ||
589 | |||
590 | hash = (Hashtable)response.Value; | ||
591 | try | ||
592 | { | ||
593 | if (hash == null) | ||
594 | { | ||
595 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUserInfo Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
596 | return info; | ||
597 | } | ||
598 | |||
599 | // Here is the actual response | ||
600 | foreach (object key in hash.Keys) | ||
601 | { | ||
602 | if (hash[key] != null) | ||
603 | { | ||
604 | info.Add(key.ToString(), hash[key]); | ||
605 | } | ||
606 | } | ||
607 | } | ||
608 | catch | ||
609 | { | ||
610 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); | ||
611 | } | ||
612 | |||
613 | return info; | ||
614 | } | ||
615 | |||
562 | public Dictionary<string, object> GetServerURLs(UUID userID) | 616 | public Dictionary<string, object> GetServerURLs(UUID userID) |
563 | { | 617 | { |
564 | Hashtable hash = new Hashtable(); | 618 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 38bcce6..1a839f3 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -486,6 +486,31 @@ namespace OpenSim.Services.HypergridService | |||
486 | return online; | 486 | return online; |
487 | } | 487 | } |
488 | 488 | ||
489 | public Dictionary<string, object> GetUserInfo(UUID userID) | ||
490 | { | ||
491 | Dictionary<string, object> info = new Dictionary<string, object>(); | ||
492 | |||
493 | if (m_UserAccountService == null) | ||
494 | { | ||
495 | m_log.WarnFormat("[USER AGENT SERVICE]: Unable to get user flags because user account service is missing"); | ||
496 | info["result"] = "fail"; | ||
497 | info["message"] = "UserAccountService is missing!"; | ||
498 | return info; | ||
499 | } | ||
500 | |||
501 | UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero /*!!!*/, userID); | ||
502 | |||
503 | if (account != null) | ||
504 | { | ||
505 | info.Add("user_flags", (object)account.UserFlags); | ||
506 | info.Add("user_created", (object)account.Created); | ||
507 | info.Add("user_title", (object)account.UserTitle); | ||
508 | info.Add("result", "success"); | ||
509 | } | ||
510 | |||
511 | return info; | ||
512 | } | ||
513 | |||
489 | public Dictionary<string, object> GetServerURLs(UUID userID) | 514 | public Dictionary<string, object> GetServerURLs(UUID userID) |
490 | { | 515 | { |
491 | if (m_UserAccountService == null) | 516 | if (m_UserAccountService == null) |
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index e86ec51..5b293ac 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs | |||
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Interfaces | |||
55 | void LogoutAgent(UUID userID, UUID sessionID); | 55 | void LogoutAgent(UUID userID, UUID sessionID); |
56 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); | 56 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); |
57 | Dictionary<string, object> GetServerURLs(UUID userID); | 57 | Dictionary<string, object> GetServerURLs(UUID userID); |
58 | Dictionary<string,object> GetUserInfo(UUID userID); | ||
58 | 59 | ||
59 | string LocateUser(UUID userID); | 60 | string LocateUser(UUID userID); |
60 | // Tries to get the universal user identifier for the targetUserId | 61 | // Tries to get the universal user identifier for the targetUserId |