remove a parameter for detection of grid fail to suport getting multiple user accounts per call and handle it where needed.

LSLKeyTest
UbitUmarov 2016-08-13 23:41:57 +01:00
parent 7c1b2a5dde
commit 1337f5f26e
7 changed files with 31 additions and 15 deletions

View File

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

View File

@ -160,9 +160,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
return account; return account;
} }
public override List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported) public override List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
{ {
suported = true;
List<UserAccount> accs = new List<UserAccount>(); List<UserAccount> accs = new List<UserAccount>();
List<string> missing = new List<string>(); List<string> missing = new List<string>();
@ -184,15 +183,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
if(missing.Count > 0) if(missing.Count > 0)
{ {
List<UserAccount> ext = base.GetUserAccounts(scopeID, missing, out suported); List<UserAccount> ext = base.GetUserAccounts(scopeID, missing);
if(suported && ext != null) if(ext != null)
accs.AddRange(ext); accs.AddRange(ext);
} }
return accs; return accs;
} }
public override bool StoreUserAccount(UserAccount data) public override bool StoreUserAccount(UserAccount data)
{ {
// This remote connector refuses to serve this method // This remote connector refuses to serve this method

View File

@ -201,9 +201,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
return null; return null;
} }
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported) public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
{ {
suported = false;
return null; return null;
} }

View File

@ -191,7 +191,27 @@ namespace OpenSim.Services.Connectors
return accounts; return accounts;
} }
public virtual List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported) public virtual List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
{
List<UserAccount> accs = new List<UserAccount>();
bool multisuported = true;
accs = doGetMultiUserAccounts(scopeID, IDs, out multisuported);
if(multisuported)
return accs;
// service does not do multi accounts so need to do it one by one
UUID uuid = UUID.Zero;
foreach(string id in IDs)
{
if(UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
accs.Add(GetUserAccount(scopeID,uuid));
}
return accs;
}
private List<UserAccount> doGetMultiUserAccounts(UUID scopeID, List<string> IDs, out bool suported)
{ {
suported = true; suported = true;
Dictionary<string, object> sendData = new Dictionary<string, object>(); Dictionary<string, object> sendData = new Dictionary<string, object>();

View File

@ -100,9 +100,8 @@ namespace OpenSim.Services.HypergridService
return null; return null;
} }
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported) public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
{ {
suported = false;
return null; return null;
} }

View File

@ -187,7 +187,7 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns> /// <returns></returns>
List<UserAccount> GetUserAccounts(UUID scopeID, string query); List<UserAccount> GetUserAccounts(UUID scopeID, string query);
List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where); List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where);
List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported); List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs);
/// <summary> /// <summary>
/// Store the data given, wich replaces the stored data, therefore must be complete. /// Store the data given, wich replaces the stored data, therefore must be complete.

View File

@ -265,9 +265,9 @@ namespace OpenSim.Services.UserAccountService
return MakeUserAccount(d[0]); return MakeUserAccount(d[0]);
} }
public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs, out bool suported) public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
{ {
suported = true; // do it one at a time db access should be fast, so no need to break its api
List<UserAccount> accs = new List<UserAccount>(); List<UserAccount> accs = new List<UserAccount>();
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;
foreach(string id in IDs) foreach(string id in IDs)