From 42a9afdc43cc63ddea75cb3baa89f2600f27aa99 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 12 Jun 2016 12:23:52 -0700 Subject: Mantis #7858: DeleteSceneObject done slightly differently. ProcessEntities now checks whether the objects have been deleted and, if so, sends an extra kill object packet, in order to compensate for potential race conditions encountered by the first one. Note: I still cannot reproduce this problem, but I was able to emulate it by adding an artificial delay on ProcessEntities, which did, indeed, result in objects not being deleted. This fix fixed my emulated scenario. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 33 ++++++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d449e82..9cee590 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -357,7 +357,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock /// /// -// protected HashSet m_killRecord; + protected List m_killRecord; // protected HashSet m_attachmentsSent; @@ -509,7 +509,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); m_entityProps = new PriorityQueue(m_scene.Entities.Count); m_fullUpdateDataBlocksBuilder = new List(); -// m_killRecord = new HashSet(); + m_killRecord = new List(); // m_attachmentsSent = new HashSet(); m_assetService = m_scene.RequestModuleInterface(); @@ -3992,7 +3992,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (EntityUpdate update in updates) ResendPrimUpdate(update); } - + private void ProcessEntityUpdates(int maxUpdates) { OpenSim.Framework.Lazy> objectUpdateBlocks = new OpenSim.Framework.Lazy>(); @@ -4005,6 +4005,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OpenSim.Framework.Lazy> terseUpdates = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> terseAgentUpdates = new OpenSim.Framework.Lazy>(); + // Check to see if this is a flush if (maxUpdates <= 0) { @@ -4033,9 +4034,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP { SceneObjectPart part = (SceneObjectPart)update.Entity; - if (part.ParentGroup.IsDeleted || part.ParentGroup.inTransit) + if (part.ParentGroup.inTransit) continue; + if (part.ParentGroup.IsDeleted) + { + // Don't send updates for objects that have been marked deleted. + // Instead send another kill object, because the first one may have gotten + // into a race condition + if (!m_killRecord.Contains(part.ParentGroup.LocalId)) + m_killRecord.Add(part.ParentGroup.LocalId); + continue; + } + if (part.ParentGroup.IsAttachment) { // Someone else's HUD, why are we getting these? if (part.ParentGroup.OwnerID != AgentId && part.ParentGroup.HasPrivateAttachmentPoint) @@ -4233,7 +4244,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - + OutPacket(packet, ThrottleOutPacketType.Task, true); } @@ -4248,7 +4259,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - + OutPacket(packet, ThrottleOutPacketType.Task, true); } @@ -4270,6 +4281,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion Packet Sending + + #region Handle deleted objects + if (m_killRecord.Count > 0) + { + SendKillObject(m_killRecord); + m_killRecord.Clear(); + } + #endregion + + } // hack.. dont use -- cgit v1.1