aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-21 15:21:27 +0000
committerJustin Clarke Casey2009-04-21 15:21:27 +0000
commitd2d0b9877fcc6150e3a2e21283ec80ef7eda9cae (patch)
tree9e311f1de83af5c33f07f85b8ebb36911fabdc41 /OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
parentFrom: Alan Webb <alan_webb@us.ibm.com> (diff)
downloadopensim-SC_OLD-d2d0b9877fcc6150e3a2e21283ec80ef7eda9cae.zip
opensim-SC_OLD-d2d0b9877fcc6150e3a2e21283ec80ef7eda9cae.tar.gz
opensim-SC_OLD-d2d0b9877fcc6150e3a2e21283ec80ef7eda9cae.tar.bz2
opensim-SC_OLD-d2d0b9877fcc6150e3a2e21283ec80ef7eda9cae.tar.xz
* Add the ability to update profiles via the cache, so that cached profiles don't become stale
* Add corresponding unit test
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 714e279..36fe6e3 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -169,6 +169,29 @@ namespace OpenSim.Framework.Communications.Cache
169 } 169 }
170 170
171 /// <summary> 171 /// <summary>
172 /// Update an existing profile
173 /// </summary>
174 /// <param name="userProfile"></param>
175 /// <returns>true if a user profile was found to update, false otherwise</returns>
176 public bool UpdateProfile(UserProfileData userProfile)
177 {
178 lock (m_userProfilesById)
179 {
180 CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
181
182 if (userInfo != null)
183 {
184 userInfo.m_userProfile = userProfile;
185 m_commsManager.UserService.UpdateUserProfile(userProfile);
186
187 return true;
188 }
189 }
190
191 return false;
192 }
193
194 /// <summary>
172 /// Populate caches with the given user profile 195 /// Populate caches with the given user profile
173 /// </summary> 196 /// </summary>
174 /// <param name="userProfile"></param> 197 /// <param name="userProfile"></param>