diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 21eb790..9efe741 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | |||
@@ -103,6 +103,8 @@ namespace OpenSim.Server.Handlers.UserAccounts | |||
103 | return GetAccount(request); | 103 | return GetAccount(request); |
104 | case "getaccounts": | 104 | case "getaccounts": |
105 | return GetAccounts(request); | 105 | return GetAccounts(request); |
106 | case "getmultiaccounts": | ||
107 | return GetMultiAccounts(request); | ||
106 | case "setaccount": | 108 | case "setaccount": |
107 | if (m_AllowSetAccount) | 109 | if (m_AllowSetAccount) |
108 | return StoreAccount(request); | 110 | return StoreAccount(request); |
@@ -201,6 +203,50 @@ namespace OpenSim.Server.Handlers.UserAccounts | |||
201 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); | 203 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); |
202 | } | 204 | } |
203 | 205 | ||
206 | byte[] GetMultiAccounts(Dictionary<string, object> request) | ||
207 | { | ||
208 | UUID scopeID = UUID.Zero; | ||
209 | if (request.ContainsKey("ScopeID") && !UUID.TryParse(request["ScopeID"].ToString(), out scopeID)) | ||
210 | return FailureResult(); | ||
211 | |||
212 | if (!request.ContainsKey("IDS")) | ||
213 | { | ||
214 | m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts called without required uuids argument"); | ||
215 | return FailureResult(); | ||
216 | } | ||
217 | |||
218 | if (!(request["IDS"] is List<string>)) | ||
219 | { | ||
220 | m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts input argument was of unexpected type {0}", request["IDS"].GetType().ToString()); | ||
221 | return FailureResult(); | ||
222 | } | ||
223 | |||
224 | List<string> userIDs = (List<string>)request["IDS"]; | ||
225 | |||
226 | List<UserAccount> accounts = m_UserAccountService.GetUserAccounts(scopeID, userIDs); | ||
227 | |||
228 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
229 | if ((accounts == null) || ((accounts != null) && (accounts.Count == 0))) | ||
230 | { | ||
231 | result["result"] = "null"; | ||
232 | } | ||
233 | else | ||
234 | { | ||
235 | int i = 0; | ||
236 | foreach (UserAccount acc in accounts) | ||
237 | { | ||
238 | Dictionary<string, object> rinfoDict = acc.ToKeyValuePairs(); | ||
239 | result["account" + i] = rinfoDict; | ||
240 | i++; | ||
241 | } | ||
242 | } | ||
243 | |||
244 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
245 | |||
246 | //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); | ||
247 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); | ||
248 | } | ||
249 | |||
204 | byte[] StoreAccount(Dictionary<string, object> request) | 250 | byte[] StoreAccount(Dictionary<string, object> request) |
205 | { | 251 | { |
206 | UUID principalID = UUID.Zero; | 252 | UUID principalID = UUID.Zero; |