From 045c26f6265ff4e66f07280da555e10a0dc9e2fa Mon Sep 17 00:00:00 2001 From: Donnie Roberts Date: Wed, 5 Jun 2013 19:55:18 -0400 Subject: [PATCH 1/4] In LocalFriendshipTerminated, send the original client's agentId to the friend being removed instead of the friend's own id. --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 6 +++--- .../CoreModules/Avatar/Friends/FriendsRequestHandler.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 4613344325..41ea2a270b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -685,7 +685,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // // Try local - if (LocalFriendshipTerminated(exfriendID)) + if (LocalFriendshipTerminated(client.AgentId, exfriendID)) return; PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() }); @@ -827,13 +827,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends return false; } - public bool LocalFriendshipTerminated(UUID exfriendID) + public bool LocalFriendshipTerminated(UUID userID, UUID exfriendID) { IClientAPI friendClient = LocateClientObject(exfriendID); if (friendClient != null) { // the friend in this sim as root agent - friendClient.SendTerminateFriend(exfriendID); + friendClient.SendTerminateFriend(userID); // update local cache RecacheFriends(friendClient); // we're done diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 637beef677..08196f14bb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs @@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (!UUID.TryParse(request["ToID"].ToString(), out toID)) return FailureResult(); - if (m_FriendsModule.LocalFriendshipTerminated(toID)) + if (m_FriendsModule.LocalFriendshipTerminated(fromID, toID)) return SuccessResult(); return FailureResult(); From f2a4d9b99cfefac622cc3d499cbdc757c4bff527 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 7 Jun 2013 19:13:24 +0100 Subject: [PATCH 2/4] Fix regression where multiple close agents could be sent to the wrong neighbour region on root agent close. This was introduced in git master d214e2d0 (Thu May 16 17:12:02 2013) Caught out by the fact that value types used in iterators act like references and this was dispatched asynchronously. Should address http://opensimulator.org/mantis/view.php?id=6658 --- .../Region/Framework/Scenes/SceneCommunicationService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 8c84c9807a..8238e23f9c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -222,7 +222,12 @@ namespace OpenSim.Region.Framework.Scenes public void SendCloseChildAgentConnections(UUID agentID, List regionslst) { foreach (ulong handle in regionslst) - Util.FireAndForget(delegate { SendCloseChildAgent(agentID, handle); }); + { + // We must take a copy here since handle is acts like a reference when used in an iterator. + // This leads to race conditions if directly passed to SendCloseChildAgent with more than one neighbour region. + ulong handleCopy = handle; + Util.FireAndForget((o) => { SendCloseChildAgent(agentID, handleCopy); }); + } } public List RequestNamedRegions(string name, int maxNumber) From 346eda27ccffd3890509360697f7e2737ac022fb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 7 Jun 2013 19:26:09 +0100 Subject: [PATCH 3/4] minor: add dr0berts to contributors list --- CONTRIBUTORS.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 36b17be1b9..7601a50690 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -75,11 +75,12 @@ what it is today. * controlbreak * coyled * Daedius -* Dong Jun Lan (IBM) -* DoranZemlja * daTwitch * devalnor-#708 * dmiles (Daxtron Labs) +* Dong Jun Lan (IBM) +* DoranZemlja +* dr0b3rts * dslake (Intel) * FredoChaplin * Garmin Kawaguichi From 454499ff60bf45f77f6f25e9164fcbbfff967bba Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 7 Jun 2013 23:38:23 +0100 Subject: [PATCH 4/4] minor: Comment out debug logging (at warn level) about number of objects force selected and turn down to debug level --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index e47397dec7..9784d15b3d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4828,7 +4828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendForceClientSelectObjects(List ObjectIDs) { - m_log.WarnFormat("[LLCLIENTVIEW] sending select with {0} objects", ObjectIDs.Count); +// m_log.DebugFormat("[LLCLIENTVIEW] sending select with {0} objects", ObjectIDs.Count); bool firstCall = true; const int MAX_OBJECTS_PER_PACKET = 251;