aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs55
1 files changed, 51 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
index 6d4ac39..77fd70b 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
59 59
60 #region ISharedRegionModule 60 #region ISharedRegionModule
61 61
62 public Type ReplaceableInterface 62 public Type ReplaceableInterface
63 { 63 {
64 get { return null; } 64 get { return null; }
65 } 65 }
@@ -129,6 +129,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
129 // FIXME: Why do we bother setting this module and caching up if we just end up registering the inner 129 // FIXME: Why do we bother setting this module and caching up if we just end up registering the inner
130 // user account service?! 130 // user account service?!
131 scene.RegisterModuleInterface<IUserAccountService>(UserAccountService); 131 scene.RegisterModuleInterface<IUserAccountService>(UserAccountService);
132 scene.RegisterModuleInterface<IUserAccountCacheModule>(m_Cache);
132 } 133 }
133 134
134 public void RemoveRegion(Scene scene) 135 public void RemoveRegion(Scene scene)
@@ -152,7 +153,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
152 public UserAccount GetUserAccount(UUID scopeID, UUID userID) 153 public UserAccount GetUserAccount(UUID scopeID, UUID userID)
153 { 154 {
154 bool inCache = false; 155 bool inCache = false;
155 UserAccount account = m_Cache.Get(userID, out inCache); 156 UserAccount account;
157 account = m_Cache.Get(userID, out inCache);
156 if (inCache) 158 if (inCache)
157 return account; 159 return account;
158 160
@@ -165,7 +167,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
165 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) 167 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
166 { 168 {
167 bool inCache = false; 169 bool inCache = false;
168 UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache); 170 UserAccount account;
171 account = m_Cache.Get(firstName + " " + lastName, out inCache);
169 if (inCache) 172 if (inCache)
170 return account; 173 return account;
171 174
@@ -181,6 +184,50 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
181 return UserAccountService.GetUserAccount(scopeID, Email); 184 return UserAccountService.GetUserAccount(scopeID, Email);
182 } 185 }
183 186
187 public List<UserAccount> GetUserAccounts(UUID scopeID, List<string> IDs)
188 {
189 List<UserAccount> ret = new List<UserAccount>();
190 List<string> missing = new List<string>();
191
192 // still another cache..
193 bool inCache = false;
194 UUID uuid = UUID.Zero;
195 UserAccount account;
196 foreach(string id in IDs)
197 {
198 if(UUID.TryParse(id, out uuid))
199 {
200 account = m_Cache.Get(uuid, out inCache);
201 if (inCache)
202 ret.Add(account);
203 else
204 missing.Add(id);
205 }
206 }
207
208 if(missing.Count == 0)
209 return ret;
210
211 List<UserAccount> ext = UserAccountService.GetUserAccounts(scopeID, missing);
212 if(ext != null && ext.Count > 0)
213 {
214 foreach(UserAccount acc in ext)
215 {
216 if(acc != null)
217 {
218 ret.Add(acc);
219 m_Cache.Cache(acc.PrincipalID, acc);
220 }
221 }
222 }
223 return ret;
224 }
225
226 public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
227 {
228 return null;
229 }
230
184 public List<UserAccount> GetUserAccounts(UUID scopeID, string query) 231 public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
185 { 232 {
186 return UserAccountService.GetUserAccounts(scopeID, query); 233 return UserAccountService.GetUserAccounts(scopeID, query);
@@ -203,4 +250,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
203 250
204 #endregion 251 #endregion
205 } 252 }
206} \ No newline at end of file 253}