From 3c2886cd7507890b03f1213ca280c4a505af52c3 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Wed, 13 May 2015 14:31:28 -0500 Subject: [PATCH] Adding back command to clear region's user cache --- .../UserManagement/UserManagementModule.cs | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index ba71dc5698..7ecbd26f0e 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement #endregion ISharedRegionModule - + #region Event Handlers void EventManager_OnPrimsLoaded(Scene s) @@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement void HandleUUIDNameRequest(UUID uuid, IClientAPI client) { // m_log.DebugFormat( -// "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}", +// "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}", // uuid, remote_client.Name); if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) @@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement // appear to clear this when the user asks it to clear the cache, but others may not. // // So to avoid clients - // (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will + // (particularly Hypergrid clients) permanently binding "Unknown User" to a given UUID, we will // instead drop the request entirely. if (GetUser(uuid, out user)) { @@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement } // else // m_log.DebugFormat( -// "[USER MANAGEMENT MODULE]: No bound name for {0} found, ignoring request from {1}", +// "[USER MANAGEMENT MODULE]: No bound name for {0} found, ignoring request from {1}", // uuid, client.Name); }); } @@ -416,7 +416,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e); userdata.ServerURLs = new Dictionary(); } - + if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null) return userdata.ServerURLs[serverType].ToString(); } @@ -620,7 +620,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement AddUser(id, string.Empty, string.Empty, string.Empty); } else - { + { string homeURL; string firstname = string.Empty; string lastname = string.Empty; @@ -676,7 +676,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement else { lock(m_UserCache) - { + { if(!m_UserCache.ContainsKey(id)) { UserData newUser = new UserData(); @@ -726,6 +726,21 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement "Show the bindings between user UUIDs and user names", String.Empty, HandleShowUsers); + + MainConsole.Instance.Commands.AddCommand("Users", true, + "reset user cache", + "reset user cache", + "reset user cache to allow changed settings to be applied", + String.Empty, + HandleResetUserCache); + } + + private void HandleResetUserCache(string module, string[] cmd) + { + lock(m_UserCache) + { + m_UserCache.Clear(); + } } private void HandleShowUser(string module, string[] cmd)