diff options
author | Diva Canto | 2012-03-17 21:27:28 -0700 |
---|---|---|
committer | Diva Canto | 2012-03-17 21:27:28 -0700 |
commit | d1256536b500a0d72eb643635d10c65980ea2588 (patch) | |
tree | b378a299d970fa5f3266a59f32baa607fee3006b /OpenSim/Services | |
parent | Amend to previous commit: normalize strings ToLower. (diff) | |
download | opensim-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')
3 files changed, 72 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); |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index f681df4..5eca801 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -566,6 +566,16 @@ namespace OpenSim.Services.HypergridService | |||
566 | 566 | ||
567 | return string.Empty; | 567 | return string.Empty; |
568 | } | 568 | } |
569 | |||
570 | public UUID GetUUID(String first, String last) | ||
571 | { | ||
572 | // Let's see if it's a local user | ||
573 | UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, first, last); | ||
574 | if (account != null) | ||
575 | return account.PrincipalID; | ||
576 | else | ||
577 | return UUID.Zero; | ||
578 | } | ||
569 | } | 579 | } |
570 | 580 | ||
571 | class TravelingAgentInfo | 581 | class TravelingAgentInfo |
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index 5b293ac..0cd44f7 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs | |||
@@ -62,6 +62,8 @@ namespace OpenSim.Services.Interfaces | |||
62 | // on behalf of the userID | 62 | // on behalf of the userID |
63 | string GetUUI(UUID userID, UUID targetUserID); | 63 | string GetUUI(UUID userID, UUID targetUserID); |
64 | 64 | ||
65 | UUID GetUUID(String first, String last); | ||
66 | |||
65 | // Returns the local friends online | 67 | // Returns the local friends online |
66 | List<UUID> StatusNotification(List<string> friends, UUID userID, bool online); | 68 | List<UUID> StatusNotification(List<string> friends, UUID userID, bool online); |
67 | //List<UUID> GetOnlineFriends(UUID userID, List<string> friends); | 69 | //List<UUID> GetOnlineFriends(UUID userID, List<string> friends); |