diff options
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r-- | OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | 2 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index b63b594..8806c2c 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | |||
@@ -228,6 +228,8 @@ namespace OpenSim.Server.Handlers.GridUser | |||
228 | int i = 0; | 228 | int i = 0; |
229 | foreach (GridUserInfo pinfo in pinfos) | 229 | foreach (GridUserInfo pinfo in pinfos) |
230 | { | 230 | { |
231 | if(pinfo == null) | ||
232 | continue; | ||
231 | Dictionary<string, object> rinfoDict = pinfo.ToKeyValuePairs(); | 233 | Dictionary<string, object> rinfoDict = pinfo.ToKeyValuePairs(); |
232 | result["griduser" + i] = rinfoDict; | 234 | result["griduser" + i] = rinfoDict; |
233 | i++; | 235 | i++; |
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 21eb790..237ffc7 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,52 @@ 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 | if(acc == null) | ||
239 | continue; | ||
240 | Dictionary<string, object> rinfoDict = acc.ToKeyValuePairs(); | ||
241 | result["account" + i] = rinfoDict; | ||
242 | i++; | ||
243 | } | ||
244 | } | ||
245 | |||
246 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
247 | |||
248 | //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); | ||
249 | return Util.UTF8NoBomEncoding.GetBytes(xmlString); | ||
250 | } | ||
251 | |||
204 | byte[] StoreAccount(Dictionary<string, object> request) | 252 | byte[] StoreAccount(Dictionary<string, object> request) |
205 | { | 253 | { |
206 | UUID principalID = UUID.Zero; | 254 | UUID principalID = UUID.Zero; |