add some wiring to have GetUserAccounts for multiple IDs on a single request to grid services. Unfinished, untested

This commit is contained in:
UbitUmarov
2016-08-13 05:22:29 +01:00
parent b64f25e631
commit 7c1b2a5dde
7 changed files with 139 additions and 0 deletions

View File

@@ -182,6 +182,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
return UserAccountService.GetUserAccount(scopeID, Email);
}
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
{
return UserAccountService.GetUserAccounts(scopeID, IDs, out suported);
}
public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
{
return null;

View File

@@ -26,6 +26,8 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using Nini.Config;
using log4net;
using Mono.Addins;
@@ -158,6 +160,39 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
return account;
}
public override List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
{
suported = true;
List<UserAccount> accs = new List<UserAccount>();
List<string> missing = new List<string>();
UUID uuid = UUID.Zero;;
UserAccount account;
bool inCache = false;
foreach(string id in IDs)
{
if(UUID.TryParse(id, out uuid))
{
account = m_Cache.Get(uuid, out inCache);
if (inCache)
accs.Add(account);
else
missing.Add(id);
}
}
if(missing.Count > 0)
{
List<UserAccount> ext = base.GetUserAccounts(scopeID, missing, out suported);
if(suported && ext != null)
accs.AddRange(ext);
}
return accs;
}
public override bool StoreUserAccount(UserAccount data)
{
// This remote connector refuses to serve this method