From 277c4f14336422cd9ea01f98643bbd7a86e301a8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 15 Apr 2021 19:54:56 +0100 Subject: [PATCH] mantis 8887: fix timing issue --- .../Avatar/Attachments/AttachmentsModule.cs | 12 ++++++++---- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 14 +++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 8889977e2f..401f4b7aa4 100755 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -341,14 +341,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } } - public void CopyAttachments(AgentData ad, IScenePresence sp) + public void CopyAttachments(AgentData ad, IScenePresence isp) { -// m_log.DebugFormat("[ATTACHMENTS MODULE]: Copying attachment data into {0} in {1}", sp.Name, m_scene.Name); + ScenePresence sp = isp as ScenePresence; if (ad.AttachmentObjects != null && ad.AttachmentObjects.Count > 0) { - lock (sp.AttachmentsSyncLock) - DeleteAttachmentsFromScene(sp, true); // delete + lock (isp.AttachmentsSyncLock) + { + if(sp.IsDeleted) + return; + DeleteAttachmentsFromScene(isp, true); // delete + } int i = 0; for (int indx = 0; indx < ad.AttachmentObjects.Count; ++indx) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index da6f25e603..f03ea943de 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -226,8 +226,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_previusParcelUUID != UUID.Zero || checksame) ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, m_currentParcelHide, m_previusParcelHide, oldhide,checksame); } - m_log.DebugFormat("[SOP {0}] set parcel from {1} to {2}", m_scene.Name, m_previusParcelUUID, m_currentParcelUUID); - } + } } public void sitSOGmoved() @@ -2300,6 +2299,16 @@ namespace OpenSim.Region.Framework.Scenes ParcelDwellTickMS = Util.GetTimeStampMS(); m_inTransit = false; + ILandChannel landch = m_scene.LandChannel; + if (landch != null) + { + ILandObject landover = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); + if (landover != null) + { + m_currentParcelHide = !landover.LandData.SeeAVs; + m_currentParcelUUID = landover.LandData.GlobalID; + } + } // Tell the client that we're ready to send rest if (!m_gotCrossUpdate) @@ -2342,7 +2351,6 @@ namespace OpenSim.Region.Framework.Scenes Scene.SendLayerData(ControllingClient); // send initial land overlay and parcel - ILandChannel landch = m_scene.LandChannel; if (landch != null) landch.sendClientInitialLandInfo(client, !m_gotCrossUpdate); }