Skip to content

Commit

Permalink
Adding back command to clear region's user cache
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueWall committed May 13, 2015
1 parent cb586d1 commit 3c2886c
Showing 1 changed file with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void Close()

#endregion ISharedRegionModule


#region Event Handlers

void EventManager_OnPrimsLoaded(Scene s)
Expand All @@ -180,7 +180,7 @@ void HandleConnectionClosed(IClientAPI client)
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))
Expand Down Expand Up @@ -212,15 +212,15 @@ void HandleUUIDNameRequest(UUID uuid, IClientAPI client)
// 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))
{
client.SendNameReply(uuid, user.FirstName, user.LastName);
}
// 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);
});
}
Expand Down Expand Up @@ -416,7 +416,7 @@ public string GetUserServerURL(UUID userID, string serverType)
m_log.Debug("[USER MANAGEMENT MODULE]: GetServerURLs call failed ", e);
userdata.ServerURLs = new Dictionary<string, object>();
}

if (userdata.ServerURLs != null && userdata.ServerURLs.ContainsKey(serverType) && userdata.ServerURLs[serverType] != null)
return userdata.ServerURLs[serverType].ToString();
}
Expand Down Expand Up @@ -620,7 +620,7 @@ public void AddUser(UUID id, string creatorData)
AddUser(id, string.Empty, string.Empty, string.Empty);
}
else
{
{
string homeURL;
string firstname = string.Empty;
string lastname = string.Empty;
Expand Down Expand Up @@ -676,7 +676,7 @@ public void AddUser(UUID id, string creatorData)
else
{
lock(m_UserCache)
{
{
if(!m_UserCache.ContainsKey(id))
{
UserData newUser = new UserData();
Expand Down Expand Up @@ -726,6 +726,21 @@ protected void RegisterConsoleCmds()
"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)
Expand Down

0 comments on commit 3c2886c

Please sign in to comment.