diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d449e8246d..9cee590ff9 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 diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 04db123d78..09dc66365a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1987,6 +1987,7 @@ namespace OpenSim.Region.Framework.Scenes { // We need to keep track of this state in case this group is still queued for backup. IsDeleted = true; + HasGroupChanged = true; DetachFromBackup(); @@ -2010,7 +2011,13 @@ namespace OpenSim.Region.Framework.Scenes if (!IsAttachment || AttachedAvatar == avatar.ControllingClient.AgentId || !HasPrivateAttachmentPoint) + { + // Send a kill object immediately avatar.ControllingClient.SendKillObject(new List { part.LocalId }); + // Also, send a terse update; in case race conditions make the object pop again in the client, + // this update will send another kill object + m_rootPart.SendTerseUpdateToClient(avatar.ControllingClient); + } } } }); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7d95c8d1e6..b4feb9a870 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5390,9 +5390,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter public void SendTerseUpdateToClient(IClientAPI remoteClient) { - if (ParentGroup.IsDeleted) - return; - if (ParentGroup.IsAttachment && (ParentGroup.RootPart != this || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint))