From 590d7ccf432c220c6daf8b4abfeec2b447ae52ef Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 23 Nov 2018 02:09:35 +0000 Subject: [PATCH] try better handling of llupd DeRezObject --- .../ClientStack/Linden/UDP/LLClientView.cs | 54 ++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index bbaa0e27ed..4be5ef3c74 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6990,8 +6990,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + uint m_DeRezObjectLasSeq = 0; + Dictionary> m_DeRezObjectDelayed = new Dictionary>(); + private bool HandlerDeRezObject(IClientAPI sender, Packet Pack) { + DeRezObject handlerDeRezObject = OnDeRezObject; + if (handlerDeRezObject == null) + return true; + DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)Pack; #region Packet Session and User Check @@ -7003,24 +7010,47 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - DeRezObject handlerDeRezObject = OnDeRezObject; - if (handlerDeRezObject != null) - { - List deRezIDs = new List(); + uint seq = DeRezPacket.Header.Sequence; + if(seq <= m_DeRezObjectLasSeq) + return true; + m_DeRezObjectLasSeq = seq; - foreach (DeRezObjectPacket.ObjectDataBlock data in - DeRezPacket.ObjectData) + List deRezIDs; + DeRezAction action = (DeRezAction)DeRezPacket.AgentBlock.Destination; + int numberPackets = DeRezPacket.AgentBlock.PacketCount; + int curPacket = DeRezPacket.AgentBlock.PacketNumber; + UUID id = DeRezPacket.AgentBlock.TransactionID; + + if (numberPackets > 1) + { + if(!m_DeRezObjectDelayed.TryGetValue(id, out deRezIDs)) + { + deRezIDs = new List(); + m_DeRezObjectDelayed[id] = deRezIDs; + } + + foreach (DeRezObjectPacket.ObjectDataBlock data in DeRezPacket.ObjectData) { deRezIDs.Add(data.ObjectLocalID); } - // It just so happens that the values on the DeRezAction enumerator match the Destination - // values given by a Second Life client - handlerDeRezObject(this, deRezIDs, - DeRezPacket.AgentBlock.GroupID, - (DeRezAction)DeRezPacket.AgentBlock.Destination, - DeRezPacket.AgentBlock.DestinationID); + if (curPacket < numberPackets - 1) + return true; + + m_DeRezObjectDelayed.Remove(id); } + else + { + deRezIDs = new List(); + foreach (DeRezObjectPacket.ObjectDataBlock data in DeRezPacket.ObjectData) + { + deRezIDs.Add(data.ObjectLocalID); + } + } + if (handlerDeRezObject != null) + handlerDeRezObject(this, deRezIDs, DeRezPacket.AgentBlock.GroupID, + action, DeRezPacket.AgentBlock.DestinationID); + return true; }