From 3d3eec436a42ced82b51ac11d03c2d98cc3d729a Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 20 Apr 2008 20:36:06 +0000 Subject: * Remove user profile from cache when they log out from a region. * A much more significant fix is required to clean up the cache when a user moves out of a region, but really better handling of delayed inventory cache updates needs to be written first, and possibly better affinity to cut down agent inventory requests when the move is between two regions hosted on the same server. --- .../Cache/UserProfileCacheService.cs | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs') diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index a9e2780..9813756 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -86,7 +86,30 @@ namespace OpenSim.Framework.Communications.Cache } } } - } + } + + /// + /// Remove this user's profile cache. + /// + /// + /// true if the user was successfully removed, false otherwise + public bool RemoveUser(LLUUID userID) + { + lock (m_userProfiles) + { + if (m_userProfiles.ContainsKey(userID)) + { + m_userProfiles.Remove(userID); + return true; + } + else + { + m_log.WarnFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID); + } + } + + return false; + } /// /// Request the inventory data for the given user. This will occur asynchronously if running on a grid -- cgit v1.1