From 607156cae844ec97b8bab273075127a6248a81c3 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Tue, 21 Apr 2009 20:12:33 +0000
Subject: * Comment out user profile cache update method for now
---
.../Communications/Cache/CachedUserInfo.cs | 2 +-
.../Cache/UserProfileCacheService.cs | 37 ++++++++++++----------
.../Tests/Cache/UserProfileCacheServiceTests.cs | 3 ++
OpenSim/Framework/UserProfileData.cs | 7 +++-
4 files changed, 30 insertions(+), 19 deletions(-)
(limited to 'OpenSim')
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
private readonly CommunicationsManager m_commsManager;
public UserProfileData UserProfile { get { return m_userProfile; } }
- protected internal UserProfileData m_userProfile;
+ private UserProfileData m_userProfile;
///
/// 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
///
///
/// true if a user profile was found to update, false otherwise
- public bool UpdateProfile(UserProfileData userProfile)
- {
- lock (m_userProfilesById)
- {
- CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
-
- if (userInfo != null)
- {
- userInfo.m_userProfile = userProfile;
- m_commsManager.UserService.UpdateUserProfile(userProfile);
-
- return true;
- }
- }
-
- return false;
- }
+ // Commented out for now. The implementation needs to be improved by protecting against race conditions,
+ // probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via
+ // returning a read only class from the cache).
+// public bool UpdateProfile(UserProfileData userProfile)
+// {
+// lock (m_userProfilesById)
+// {
+// CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
+//
+// if (userInfo != null)
+// {
+// userInfo.m_userProfile = userProfile;
+// m_commsManager.UserService.UpdateUserProfile(userProfile);
+//
+// return true;
+// }
+// }
+//
+// return false;
+// }
///
/// 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
Assert.That(existingUserInfo, Is.Not.Null, "User info not found by name");
}
+ /**
+ * Disabled as not fully implemented
[Test]
public void TestUpdateProfile()
{
@@ -101,6 +103,7 @@ namespace OpenSim.Framework.Communications.Tests
Assert.That(retrievedProfile.SurName, Is.EqualTo(newLastName));
Assert.That(userDataPlugin.GetUserByUUID(userId).SurName, Is.EqualTo(newLastName));
}
+ */
[Test]
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
///
public virtual ulong HomeRegion
{
- get { return Utils.UIntsToLong((m_homeRegionX * (uint)Constants.RegionSize), (m_homeRegionY * (uint)Constants.RegionSize)); }
+ get
+ {
+ return Utils.UIntsToLong(
+ m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize);
+ }
+
set
{
m_homeRegionX = (uint) (value >> 40);
--
cgit v1.1