aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorUbitUmarov2016-08-13 05:22:29 +0100
committerUbitUmarov2016-08-13 05:22:29 +0100
commit7c1b2a5dde3b61dae4cca6bff7d2fe560be96fae (patch)
tree09a79ea66f619af6295e20b8c92b397cd90ebafc /OpenSim/Services/Connectors
parent add a missing cast to ulong in RegionGridLocToHandle (mantis: 7994) (diff)
downloadopensim-SC_OLD-7c1b2a5dde3b61dae4cca6bff7d2fe560be96fae.zip
opensim-SC_OLD-7c1b2a5dde3b61dae4cca6bff7d2fe560be96fae.tar.gz
opensim-SC_OLD-7c1b2a5dde3b61dae4cca6bff7d2fe560be96fae.tar.bz2
opensim-SC_OLD-7c1b2a5dde3b61dae4cca6bff7d2fe560be96fae.tar.xz
add some wiring to have GetUserAccounts for multiple IDs on a single request to grid services. Unfinished, untested
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs72
2 files changed, 78 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 }