diff options
Diffstat (limited to 'OpenSim/Framework/Communications')
3 files changed, 24 insertions, 18 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 98ec287..52869b1 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
65 | private readonly CommunicationsManager m_commsManager; | 65 | private readonly CommunicationsManager m_commsManager; |
66 | 66 | ||
67 | public UserProfileData UserProfile { get { return m_userProfile; } } | 67 | public UserProfileData UserProfile { get { return m_userProfile; } } |
68 | protected internal UserProfileData m_userProfile; | 68 | private UserProfileData m_userProfile; |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Have we received the user's inventory from the inventory service? | 71 | /// Have we received the user's inventory from the inventory service? |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 36fe6e3..8f37f27 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -173,23 +173,26 @@ namespace OpenSim.Framework.Communications.Cache | |||
173 | /// </summary> | 173 | /// </summary> |
174 | /// <param name="userProfile"></param> | 174 | /// <param name="userProfile"></param> |
175 | /// <returns>true if a user profile was found to update, false otherwise</returns> | 175 | /// <returns>true if a user profile was found to update, false otherwise</returns> |
176 | public bool UpdateProfile(UserProfileData userProfile) | 176 | // Commented out for now. The implementation needs to be improved by protecting against race conditions, |
177 | { | 177 | // probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via |
178 | lock (m_userProfilesById) | 178 | // returning a read only class from the cache). |
179 | { | 179 | // public bool UpdateProfile(UserProfileData userProfile) |
180 | CachedUserInfo userInfo = GetUserDetails(userProfile.ID); | 180 | // { |
181 | 181 | // lock (m_userProfilesById) | |
182 | if (userInfo != null) | 182 | // { |
183 | { | 183 | // CachedUserInfo userInfo = GetUserDetails(userProfile.ID); |
184 | userInfo.m_userProfile = userProfile; | 184 | // |
185 | m_commsManager.UserService.UpdateUserProfile(userProfile); | 185 | // if (userInfo != null) |
186 | 186 | // { | |
187 | return true; | 187 | // userInfo.m_userProfile = userProfile; |
188 | } | 188 | // m_commsManager.UserService.UpdateUserProfile(userProfile); |
189 | } | 189 | // |
190 | 190 | // return true; | |
191 | return false; | 191 | // } |
192 | } | 192 | // } |
193 | // | ||
194 | // return false; | ||
195 | // } | ||
193 | 196 | ||
194 | /// <summary> | 197 | /// <summary> |
195 | /// Populate caches with the given user profile | 198 | /// Populate caches with the given user profile |
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs index c7f3bfc..1711187 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs | |||
@@ -71,6 +71,8 @@ namespace OpenSim.Framework.Communications.Tests | |||
71 | Assert.That(existingUserInfo, Is.Not.Null, "User info not found by name"); | 71 | Assert.That(existingUserInfo, Is.Not.Null, "User info not found by name"); |
72 | } | 72 | } |
73 | 73 | ||
74 | /** | ||
75 | * Disabled as not fully implemented | ||
74 | [Test] | 76 | [Test] |
75 | public void TestUpdateProfile() | 77 | public void TestUpdateProfile() |
76 | { | 78 | { |
@@ -101,6 +103,7 @@ namespace OpenSim.Framework.Communications.Tests | |||
101 | Assert.That(retrievedProfile.SurName, Is.EqualTo(newLastName)); | 103 | Assert.That(retrievedProfile.SurName, Is.EqualTo(newLastName)); |
102 | Assert.That(userDataPlugin.GetUserByUUID(userId).SurName, Is.EqualTo(newLastName)); | 104 | Assert.That(userDataPlugin.GetUserByUUID(userId).SurName, Is.EqualTo(newLastName)); |
103 | } | 105 | } |
106 | */ | ||
104 | 107 | ||
105 | [Test] | 108 | [Test] |
106 | public void TestFetchInventory() | 109 | public void TestFetchInventory() |