diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index f55de5a..07fee79 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -46,6 +46,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
46 | MethodBase.GetCurrentMethod().DeclaringType); | 46 | MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private IUserAccountService m_UserService; | 48 | private IUserAccountService m_UserService; |
49 | private UserAccountCache m_Cache; | ||
49 | 50 | ||
50 | private bool m_Enabled = false; | 51 | private bool m_Enabled = false; |
51 | 52 | ||
@@ -96,6 +97,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
96 | return; | 97 | return; |
97 | } | 98 | } |
98 | m_Enabled = true; | 99 | m_Enabled = true; |
100 | m_Cache = new UserAccountCache(); | ||
101 | |||
99 | m_log.Info("[USER CONNECTOR]: Local user connector enabled"); | 102 | m_log.Info("[USER CONNECTOR]: Local user connector enabled"); |
100 | } | 103 | } |
101 | } | 104 | } |
@@ -139,12 +142,28 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
139 | 142 | ||
140 | public UserAccount GetUserAccount(UUID scopeID, UUID userID) | 143 | public UserAccount GetUserAccount(UUID scopeID, UUID userID) |
141 | { | 144 | { |
142 | return m_UserService.GetUserAccount(scopeID, userID); | 145 | UserAccount account = m_Cache.Get(userID); |
146 | if (account != null) | ||
147 | return account; | ||
148 | |||
149 | account = m_UserService.GetUserAccount(scopeID, userID); | ||
150 | if (account != null) | ||
151 | m_Cache.Cache(account); | ||
152 | |||
153 | return account; | ||
143 | } | 154 | } |
144 | 155 | ||
145 | public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName) | 156 | public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) |
146 | { | 157 | { |
147 | return m_UserService.GetUserAccount(scopeID, FirstName, LastName); | 158 | UserAccount account = m_Cache.Get(firstName + " " + lastName); |
159 | if (account != null) | ||
160 | return account; | ||
161 | |||
162 | account = m_UserService.GetUserAccount(scopeID, firstName, lastName); | ||
163 | if (account != null) | ||
164 | m_Cache.Cache(account); | ||
165 | |||
166 | return account; | ||
148 | } | 167 | } |
149 | 168 | ||
150 | public UserAccount GetUserAccount(UUID scopeID, string Email) | 169 | public UserAccount GetUserAccount(UUID scopeID, string Email) |