aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs72
-rw-r--r--OpenSim/Services/HypergridService/UserAccountCache.cs6
-rw-r--r--OpenSim/Services/Interfaces/IUserAccountService.cs1
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs13
5 files changed, 98 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 563a1e7..1ef5ad2 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -201,6 +201,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
201 return null; 201 return null;
202 } 202 }
203 203
204 public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
205 {
206 suported = false;
207 return null;
208 }
209
204 public bool StoreUserAccount(UserAccount data) 210 public bool StoreUserAccount(UserAccount data)
205 { 211 {
206// m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); 212// m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name);
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 }
diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs
index 6c3c655..618bd97 100644
--- a/OpenSim/Services/HypergridService/UserAccountCache.cs
+++ b/OpenSim/Services/HypergridService/UserAccountCache.cs
@@ -100,6 +100,12 @@ namespace OpenSim.Services.HypergridService
100 return null; 100 return null;
101 } 101 }
102 102
103 public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
104 {
105 suported = false;
106 return null;
107 }
108
103 public void InvalidateCache(UUID userID) 109 public void InvalidateCache(UUID userID)
104 { 110 {
105 m_UUIDCache.Remove(userID); 111 m_UUIDCache.Remove(userID);
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs
index 1814699..1914040 100644
--- a/OpenSim/Services/Interfaces/IUserAccountService.cs
+++ b/OpenSim/Services/Interfaces/IUserAccountService.cs
@@ -187,6 +187,7 @@ namespace OpenSim.Services.Interfaces
187 /// <returns></returns> 187 /// <returns></returns>
188 List<UserAccount> GetUserAccounts(UUID scopeID, string query); 188 List<UserAccount> GetUserAccounts(UUID scopeID, string query);
189 List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where); 189 List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where);
190 List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported);
190 191
191 /// <summary> 192 /// <summary>
192 /// Store the data given, wich replaces the stored data, therefore must be complete. 193 /// Store the data given, wich replaces the stored data, therefore must be complete.
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 6010f0c..fbe5e3b 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -265,6 +265,19 @@ namespace OpenSim.Services.UserAccountService
265 return MakeUserAccount(d[0]); 265 return MakeUserAccount(d[0]);
266 } 266 }
267 267
268 public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
269 {
270 suported = true;
271 List<UserAccount> accs = new List<UserAccount>();
272 UUID uuid = UUID.Zero;
273 foreach(string id in IDs)
274 {
275 if (UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
276 accs.Add(GetUserAccount(scopeID, uuid));
277 }
278 return accs;
279 }
280
268 public void InvalidateCache(UUID userID) 281 public void InvalidateCache(UUID userID)
269 { 282 {
270 } 283 }