From 1337f5f26e628dc7c5d038ffee5e957d95a72566 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 13 Aug 2016 23:41:57 +0100 Subject: remove a parameter for detection of grid fail to suport getting multiple user accounts per call and handle it where needed. --- .../SimianUserAccountServiceConnector.cs | 3 +-- .../UserAccounts/UserAccountServicesConnector.cs | 22 +++++++++++++++++++++- .../Services/HypergridService/UserAccountCache.cs | 3 +-- OpenSim/Services/Interfaces/IUserAccountService.cs | 2 +- .../UserAccountService/UserAccountService.cs | 4 ++-- 5 files changed, 26 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 1ef5ad2..6f613c1 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -201,9 +201,8 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } - public List GetUserAccounts(UUID scopeID, List IDs, out bool suported) + public List GetUserAccounts(UUID scopeID, List IDs) { - suported = false; return null; } diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs index e625143..5bc7a1c 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs @@ -191,7 +191,27 @@ namespace OpenSim.Services.Connectors return accounts; } - public virtual List GetUserAccounts(UUID scopeID, List IDs, out bool suported) + public virtual List GetUserAccounts(UUID scopeID, List IDs) + { + List accs = new List(); + 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 doGetMultiUserAccounts(UUID scopeID, List IDs, out bool suported) { suported = true; Dictionary sendData = new Dictionary(); diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs index 618bd97..25ffb63 100644 --- a/OpenSim/Services/HypergridService/UserAccountCache.cs +++ b/OpenSim/Services/HypergridService/UserAccountCache.cs @@ -100,9 +100,8 @@ namespace OpenSim.Services.HypergridService return null; } - public List GetUserAccounts(UUID scopeID, List IDs, out bool suported) + public List GetUserAccounts(UUID scopeID, List IDs) { - suported = false; return null; } diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 1914040..c6f3ef3 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -187,7 +187,7 @@ namespace OpenSim.Services.Interfaces /// List GetUserAccounts(UUID scopeID, string query); List GetUserAccountsWhere(UUID scopeID, string where); - List GetUserAccounts(UUID scopeID, List IDs, out bool suported); + List GetUserAccounts(UUID scopeID, List IDs); /// /// Store the data given, wich replaces the stored data, therefore must be complete. diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index fbe5e3b..668fe53 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -265,9 +265,9 @@ namespace OpenSim.Services.UserAccountService return MakeUserAccount(d[0]); } - public List GetUserAccounts(UUID scopeID, List IDs, out bool suported) + public List GetUserAccounts(UUID scopeID, List IDs) { - suported = true; + // do it one at a time db access should be fast, so no need to break its api List accs = new List(); UUID uuid = UUID.Zero; foreach(string id in IDs) -- cgit v1.1