aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs72
1 files changed, 72 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
index 3de0a20..e625143 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
@@ -191,6 +191,78 @@ namespace OpenSim.Services.Connectors
191 return accounts; 191 return accounts;
192 } 192 }
193 193
194 public virtual List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
195 {
196 suported = true;
197 Dictionary<string, object> sendData = new Dictionary<string, object>();
198 //sendData["SCOPEID"] = scopeID.ToString();
199 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
200 sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
201 sendData["METHOD"] = "getmultiaccounts";
202
203 sendData["ScopeID"] = scopeID.ToString();
204 sendData["IDS"] = new List<string>(IDs);
205
206 string reply = string.Empty;
207 string reqString = ServerUtils.BuildQueryString(sendData);
208 string uri = m_ServerURI + "/accounts";
209 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString);
210 try
211 {
212 reply = SynchronousRestFormsRequester.MakeRequest("POST",
213 uri,
214 reqString,
215 m_Auth);
216 if (reply == null || (reply != null && reply == string.Empty))
217 {
218 m_log.DebugFormat("[ACCOUNT CONNECTOR]: GetMultiUserAccounts received null or empty reply");
219 return null;
220 }
221 }
222 catch (Exception e)
223 {
224 m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user accounts server at {0}: {1}", uri, e.Message);
225 }
226
227 List<UserAccount> accounts = new List<UserAccount>();
228
229 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
230
231 if (replyData != null)
232 {
233 if (replyData.ContainsKey("result"))
234 {
235 if(replyData["result"].ToString() == "null")
236 return accounts;
237
238 if(replyData["result"].ToString() == "Failure")
239 {
240 suported = false;
241 return accounts;
242 }
243 }
244
245 Dictionary<string, object>.ValueCollection accountList = replyData.Values;
246 //m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetAgents returned {0} elements", pinfosList.Count);
247 foreach (object acc in accountList)
248 {
249 if (acc is Dictionary<string, object>)
250 {
251 UserAccount pinfo = new UserAccount((Dictionary<string, object>)acc);
252 accounts.Add(pinfo);
253 }
254 else
255 m_log.DebugFormat("[ACCOUNT CONNECTOR]: GetMultiUserAccounts received invalid response type {0}",
256 acc.GetType());
257 }
258 }
259 else
260 m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetMultiUserAccounts received null response");
261
262 return accounts;
263 }
264
265
194 public void InvalidateCache(UUID userID) 266 public void InvalidateCache(UUID userID)
195 { 267 {
196 } 268 }