aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-21 20:12:33 +0000
committerJustin Clarke Casey2009-04-21 20:12:33 +0000
commit607156cae844ec97b8bab273075127a6248a81c3 (patch)
tree4f8b9c474fc0ce3f23feeb623fadb8bd366ec654
parentThank you kindly, TLaukkan for a patch that: (diff)
downloadopensim-SC_OLD-607156cae844ec97b8bab273075127a6248a81c3.zip
opensim-SC_OLD-607156cae844ec97b8bab273075127a6248a81c3.tar.gz
opensim-SC_OLD-607156cae844ec97b8bab273075127a6248a81c3.tar.bz2
opensim-SC_OLD-607156cae844ec97b8bab273075127a6248a81c3.tar.xz
* Comment out user profile cache update method for now
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs2
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs37
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs3
-rw-r--r--OpenSim/Framework/UserProfileData.cs7
4 files changed, 30 insertions, 19 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()
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index 0ddf5ab..04abfd6 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -156,7 +156,12 @@ namespace OpenSim.Framework
156 /// </summary> 156 /// </summary>
157 public virtual ulong HomeRegion 157 public virtual ulong HomeRegion
158 { 158 {
159 get { return Utils.UIntsToLong((m_homeRegionX * (uint)Constants.RegionSize), (m_homeRegionY * (uint)Constants.RegionSize)); } 159 get
160 {
161 return Utils.UIntsToLong(
162 m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize);
163 }
164
160 set 165 set
161 { 166 {
162 m_homeRegionX = (uint) (value >> 40); 167 m_homeRegionX = (uint) (value >> 40);