From 045c26f6265ff4e66f07280da555e10a0dc9e2fa Mon Sep 17 00:00:00 2001 From: Donnie Roberts Date: Wed, 5 Jun 2013 19:55:18 -0400 Subject: 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 +++--- OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 4613344..41ea2a2 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 637beef..08196f1 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(); -- cgit v1.1 From f2a4d9b99cfefac622cc3d499cbdc757c4bff527 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 7 Jun 2013 19:13:24 +0100 Subject: 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 --- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 8c84c98..8238e23 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) -- cgit v1.1