diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 475066e..ed77e20 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs | |||
@@ -80,6 +80,34 @@ namespace OpenSim.Region.Communications.OGS1 | |||
80 | return userData; | 80 | return userData; |
81 | } | 81 | } |
82 | 82 | ||
83 | public List<AvatarPickerAvatar> ConvertXMLRPCDataToAvatarPickerList(LLUUID queryID,Hashtable data) | ||
84 | { | ||
85 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); | ||
86 | int pickercount = Convert.ToInt32((string)data["avcount"]); | ||
87 | LLUUID respqueryID = new LLUUID((string)data["queryid"]); | ||
88 | if (queryID == respqueryID) | ||
89 | { | ||
90 | for (int i = 0; i < pickercount; i++) | ||
91 | { | ||
92 | AvatarPickerAvatar apicker = new AvatarPickerAvatar(); | ||
93 | LLUUID avatarID = new LLUUID((string)data["avatarid" + i.ToString()]); | ||
94 | string firstname = (string)data["firstname" + i.ToString()]; | ||
95 | string lastname = (string)data["lastname" + i.ToString()]; | ||
96 | apicker.AvatarID = avatarID; | ||
97 | apicker.firstName = firstname; | ||
98 | apicker.lastName = lastname; | ||
99 | pickerlist.Add(apicker); | ||
100 | } | ||
101 | } | ||
102 | else | ||
103 | { | ||
104 | MainLog.Instance.Warn("INTERGRID", "Got invalid queryID from userServer"); | ||
105 | } | ||
106 | return pickerlist; | ||
107 | |||
108 | } | ||
109 | |||
110 | |||
83 | public UserProfileData GetUserProfile(string firstName, string lastName) | 111 | public UserProfileData GetUserProfile(string firstName, string lastName) |
84 | { | 112 | { |
85 | return GetUserProfile(firstName + " " + lastName); | 113 | return GetUserProfile(firstName + " " + lastName); |
@@ -89,7 +117,25 @@ namespace OpenSim.Region.Communications.OGS1 | |||
89 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) | 117 | public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) |
90 | { | 118 | { |
91 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); | 119 | List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); |
92 | 120 | System.Text.RegularExpressions.Regex objAlphaNumericPattern = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9 ]"); | |
121 | try | ||
122 | { | ||
123 | Hashtable param = new Hashtable(); | ||
124 | param["queryid"] = (string)queryID.ToStringHyphenated(); | ||
125 | param["avquery"] = objAlphaNumericPattern.Replace(query, ""); | ||
126 | IList parameters = new ArrayList(); | ||
127 | parameters.Add(param); | ||
128 | XmlRpcRequest req = new XmlRpcRequest("get_avatar_picker_avatar", parameters); | ||
129 | XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000); | ||
130 | Hashtable respData = (Hashtable)resp.Value; | ||
131 | pickerlist = ConvertXMLRPCDataToAvatarPickerList(queryID,respData); | ||
132 | } | ||
133 | catch (WebException e) | ||
134 | { | ||
135 | MainLog.Instance.Warn("Error when trying to fetch Avatar Picker Response: " + | ||
136 | e.Message); | ||
137 | // Return Empty picker list (no results) | ||
138 | } | ||
93 | return pickerlist; | 139 | return pickerlist; |
94 | } | 140 | } |
95 | public UserProfileData GetUserProfile(string name) | 141 | public UserProfileData GetUserProfile(string name) |