From a88381ba8252cc194f49764a28f568364bd4a7d5 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 15 Nov 2011 16:12:35 +0000 Subject: [PATCH] Rename FetchFriendslist() -> CacheFriends() and RefetchFriends() -> RecacheFriends() to reflect their intended function --- .../Avatar/Friends/FriendsModule.cs | 23 +++++++++---------- .../Avatar/Friends/HGFriendsModule.cs | 5 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index cb05c83d3e..1da0b6d5eb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -255,24 +255,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends client.OnTerminateFriendship += (thisClient, agentID, exfriendID) => RemoveFriendship(thisClient, exfriendID); client.OnGrantUserRights += OnGrantUserRights; - // Do not do this asynchronously. If we do, then subsequent code can outrace FetchFriendsList() and + // Do not do this asynchronously. If we do, then subsequent code can outrace CacheFriends() and // return misleading results from the still empty friends cache. // If we absolutely need to do this asynchronously, then a signalling mechanism is needed so that calls - // to GetFriends() will wait until FetchFriendslist() completes. Locks are insufficient. - FetchFriendslist(client); + // to GetFriends() will wait until CacheFriends() completes. Locks are insufficient. + CacheFriends(client); } /// - /// Fetch the friends list or increment the refcount for the existing - /// friends list. + /// Cache the friends list or increment the refcount for the existing friends list. /// /// /// /// /// Returns true if the list was fetched, false if it wasn't /// - protected virtual bool FetchFriendslist(IClientAPI client) + protected virtual bool CacheFriends(IClientAPI client) { UUID agentID = client.AgentId; lock (m_Friends) @@ -319,7 +318,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private void OnMakeRootAgent(ScenePresence sp) { - RefetchFriends(sp.ControllingClient); + RecacheFriends(sp.ControllingClient); } private void OnClientLogin(IClientAPI client) @@ -613,7 +612,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends StoreFriendships(client.AgentId, friendID); // Update the local cache - RefetchFriends(client); + RecacheFriends(client); // // Notify the friend @@ -675,7 +674,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends client.SendAlertMessage("Unable to terminate friendship on this sim."); // Update local cache - RefetchFriends(client); + RecacheFriends(client); client.SendTerminateFriend(exfriendID); @@ -789,7 +788,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends friendClient.SendInstantMessage(im); // Update the local cache - RefetchFriends(friendClient); + RecacheFriends(friendClient); // we're done return true; @@ -822,7 +821,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // the friend in this sim as root agent friendClient.SendTerminateFriend(exfriendID); // update local cache - RefetchFriends(friendClient); + RecacheFriends(friendClient); // we're done return true; } @@ -921,7 +920,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends return FriendsService.GetFriends(client.AgentId); } - private void RefetchFriends(IClientAPI client) + private void RecacheFriends(IClientAPI client) { UUID agentID = client.AgentId; lock (m_Friends) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index dda67f9c2b..a35d5bf2da 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -30,7 +30,6 @@ using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Threading; - using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -84,9 +83,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends #endregion - protected override bool FetchFriendslist(IClientAPI client) + protected override bool CacheFriends(IClientAPI client) { - if (base.FetchFriendslist(client)) + if (base.CacheFriends(client)) { UUID agentID = client.AgentId; // we do this only for the root agent