add GetMultiAccounts USER SERVICE HANDLER. UNTESTED !!!

LSLKeyTest
UbitUmarov 2016-08-17 06:24:58 +01:00
parent 04ea34f379
commit 9f88273741
1 changed files with 46 additions and 0 deletions

View File

@ -103,6 +103,8 @@ namespace OpenSim.Server.Handlers.UserAccounts
return GetAccount(request); return GetAccount(request);
case "getaccounts": case "getaccounts":
return GetAccounts(request); return GetAccounts(request);
case "getmultiaccounts":
return GetMultiAccounts(request);
case "setaccount": case "setaccount":
if (m_AllowSetAccount) if (m_AllowSetAccount)
return StoreAccount(request); return StoreAccount(request);
@ -201,6 +203,50 @@ namespace OpenSim.Server.Handlers.UserAccounts
return Util.UTF8NoBomEncoding.GetBytes(xmlString); return Util.UTF8NoBomEncoding.GetBytes(xmlString);
} }
byte[] GetMultiAccounts(Dictionary<string, object> request)
{
UUID scopeID = UUID.Zero;
if (request.ContainsKey("ScopeID") && !UUID.TryParse(request["ScopeID"].ToString(), out scopeID))
return FailureResult();
if (!request.ContainsKey("IDS"))
{
m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts called without required uuids argument");
return FailureResult();
}
if (!(request["IDS"] is List<string>))
{
m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts input argument was of unexpected type {0}", request["IDS"].GetType().ToString());
return FailureResult();
}
List<string> userIDs = (List<string>)request["IDS"];
List<UserAccount> accounts = m_UserAccountService.GetUserAccounts(scopeID, userIDs);
Dictionary<string, object> result = new Dictionary<string, object>();
if ((accounts == null) || ((accounts != null) && (accounts.Count == 0)))
{
result["result"] = "null";
}
else
{
int i = 0;
foreach (UserAccount acc in accounts)
{
Dictionary<string, object> rinfoDict = acc.ToKeyValuePairs();
result["account" + i] = rinfoDict;
i++;
}
}
string xmlString = ServerUtils.BuildXmlResponse(result);
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
}
byte[] StoreAccount(Dictionary<string, object> request) byte[] StoreAccount(Dictionary<string, object> request)
{ {
UUID principalID = UUID.Zero; UUID principalID = UUID.Zero;