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 57b6d16..5b27cf6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -561,6 +561,60 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
561 | return online; | 561 | return online; |
562 | } | 562 | } |
563 | 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 | |||
564 | public Dictionary<string, object> GetServerURLs(UUID userID) | 618 | public Dictionary<string, object> GetServerURLs(UUID userID) |
565 | { | 619 | { |
566 | Hashtable hash = new Hashtable(); | 620 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 8538660..f681df4 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -488,6 +488,31 @@ namespace OpenSim.Services.HypergridService | |||
488 | return online; | 488 | return online; |
489 | } | 489 | } |
490 | 490 | ||
491 | public Dictionary<string, object> GetUserInfo(UUID userID) | ||
492 | { | ||
493 | Dictionary<string, object> info = new Dictionary<string, object>(); | ||
494 | |||
495 | if (m_UserAccountService == null) | ||
496 | { | ||
497 | m_log.WarnFormat("[USER AGENT SERVICE]: Unable to get user flags because user account service is missing"); | ||
498 | info["result"] = "fail"; | ||
499 | info["message"] = "UserAccountService is missing!"; | ||
500 | return info; | ||
501 | } | ||
502 | |||
503 | UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero /*!!!*/, userID); | ||
504 | |||
505 | if (account != null) | ||
506 | { | ||
507 | info.Add("user_flags", (object)account.UserFlags); | ||
508 | info.Add("user_created", (object)account.Created); | ||
509 | info.Add("user_title", (object)account.UserTitle); | ||
510 | info.Add("result", "success"); | ||
511 | } | ||
512 | |||
513 | return info; | ||
514 | } | ||
515 | |||
491 | public Dictionary<string, object> GetServerURLs(UUID userID) | 516 | public Dictionary<string, object> GetServerURLs(UUID userID) |
492 | { | 517 | { |
493 | if (m_UserAccountService == null) | 518 | 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 |