diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | 55 |
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 | } |