diff options
author | Justin Clark-Casey (justincc) | 2012-03-28 23:40:25 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-28 23:40:25 +0100 |
commit | d9f7b8549b3cb9699eb8bd54242d31aac0f8241a (patch) | |
tree | d58aaac2914a63dd459931a31b17b16f1d0e34d9 /OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-d9f7b8549b3cb9699eb8bd54242d31aac0f8241a.zip opensim-SC_OLD-d9f7b8549b3cb9699eb8bd54242d31aac0f8241a.tar.gz opensim-SC_OLD-d9f7b8549b3cb9699eb8bd54242d31aac0f8241a.tar.bz2 opensim-SC_OLD-d9f7b8549b3cb9699eb8bd54242d31aac0f8241a.tar.xz |
Simplify friends caching by only doing this for root agents - no functions require caching for child agents.
This allows us to avoid unnecessary multiple calls to the friends service.
All friends functions originate from the root agent and only go to other root agents in existing code.
This also allows us to eliminate complex ref counting.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index e50a84a..7bc3018 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
121 | { | 121 | { |
122 | UUID agentID = client.AgentId; | 122 | UUID agentID = client.AgentId; |
123 | // we do this only for the root agent | 123 | // we do this only for the root agent |
124 | if (m_Friends[agentID].Refcount == 1) | 124 | if (!client.SceneAgent.IsChildAgent) |
125 | { | 125 | { |
126 | // We need to preload the user management cache with the names | 126 | // We need to preload the user management cache with the names |
127 | // of foreign friends, just like we do with SOPs' creators | 127 | // of foreign friends, just like we do with SOPs' creators |
@@ -426,14 +426,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
426 | agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode); | 426 | agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode); |
427 | agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); | 427 | agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); |
428 | agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); | 428 | agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); |
429 | RecacheFriends(agentClient); | 429 | CacheFriends(agentClient); |
430 | } | 430 | } |
431 | if (friendClient != null) | 431 | if (friendClient != null) |
432 | { | 432 | { |
433 | friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode); | 433 | friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode); |
434 | friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit); | 434 | friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit); |
435 | friendFriendService = friendClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); | 435 | friendFriendService = friendClientCircuit.ServiceURLs["FriendsServerURI"].ToString(); |
436 | RecacheFriends(friendClient); | 436 | CacheFriends(friendClient); |
437 | } | 437 | } |
438 | 438 | ||
439 | m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}", | 439 | m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}", |