From 675d40357c2ba0bf2d268cc35874dabe7dbb724d Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 8 Mar 2012 18:31:58 +0100 Subject: [PATCH 1/2] Hold a ref to the prim we're sat on rather than querying scene each time the check for significant is carried out. Prevents a deadlock condition. --- .../Region/Framework/Scenes/ScenePresence.cs | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ec6bb89684..9d5cdfaf1b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -457,15 +457,8 @@ namespace OpenSim.Region.Framework.Scenes // without the parent rotation applied. if (ParentID != 0) { - SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); - if (part != null) - { - return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); - } - else - { - return ParentPosition + m_pos; - } + SceneObjectPart part = ParentPart; + return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); } } return m_pos; @@ -576,6 +569,13 @@ namespace OpenSim.Region.Framework.Scenes } private uint m_parentID; + public SceneObjectPart ParentPart + { + get { return m_parentPart; } + set { m_parentPart = value; } + } + private SceneObjectPart m_parentPart = null; + public float Health { get { return m_health; } @@ -1751,36 +1751,34 @@ namespace OpenSim.Region.Framework.Scenes if (ParentID != 0) { - SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID); - if (part != null) + SceneObjectPart part = ParentPart; + TaskInventoryDictionary taskIDict = part.TaskInventory; + if (taskIDict != null) { - TaskInventoryDictionary taskIDict = part.TaskInventory; - if (taskIDict != null) + lock (taskIDict) { - lock (taskIDict) + foreach (UUID taskID in taskIDict.Keys) { - foreach (UUID taskID in taskIDict.Keys) - { - UnRegisterControlEventsToScript(LocalId, taskID); - taskIDict[taskID].PermsMask &= ~( - 2048 | //PERMISSION_CONTROL_CAMERA - 4); // PERMISSION_TAKE_CONTROLS - } + UnRegisterControlEventsToScript(LocalId, taskID); + taskIDict[taskID].PermsMask &= ~( + 2048 | //PERMISSION_CONTROL_CAMERA + 4); // PERMISSION_TAKE_CONTROLS } } - - // Reset sit target. - if (part.SitTargetAvatar == UUID) - part.SitTargetAvatar = UUID.Zero; - - ParentPosition = part.GetWorldPosition(); - ControllingClient.SendClearFollowCamProperties(part.ParentUUID); } + // Reset sit target. + if (part.SitTargetAvatar == UUID) + part.SitTargetAvatar = UUID.Zero; + + ParentPosition = part.GetWorldPosition(); + ControllingClient.SendClearFollowCamProperties(part.ParentUUID); + m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); ParentPosition = Vector3.Zero; ParentID = 0; + ParentPart = null; SendAvatarDataToAllAgents(); m_requestedSitTargetID = 0; @@ -2212,6 +2210,10 @@ namespace OpenSim.Region.Framework.Scenes return; } + ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); + if (ParentPart == null) + return; + ParentID = m_requestedSitTargetID; Velocity = Vector3.Zero; From 9c8ef96301a0ff11dd5faa191b7fd49e7d1bf79d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 8 Mar 2012 15:55:43 -0800 Subject: [PATCH 2/2] Fixes mantis #5923 --- OpenSim/Services/HypergridService/GatekeeperService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 0a59f86955..4e386879cc 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -296,9 +296,10 @@ namespace OpenSim.Services.HypergridService aCircuit.firstname = account.FirstName; aCircuit.lastname = account.LastName; } - if (account == null && !aCircuit.lastname.StartsWith("@")) + if (account == null) { - aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; + if (!aCircuit.lastname.StartsWith("@")) + aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; try { Uri uri = new Uri(aCircuit.ServiceURLs["HomeURI"].ToString());