From 590d7ccf432c220c6daf8b4abfeec2b447ae52ef Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 23 Nov 2018 02:09:35 +0000 Subject: try better handling of llupd DeRezObject --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 52 +++++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index bbaa0e2..4be5ef3 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) + uint seq = DeRezPacket.Header.Sequence; + if(seq <= m_DeRezObjectLasSeq) + return true; + m_DeRezObjectLasSeq = seq; + + 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) { - List deRezIDs = new List(); + if(!m_DeRezObjectDelayed.TryGetValue(id, out deRezIDs)) + { + deRezIDs = new List(); + m_DeRezObjectDelayed[id] = deRezIDs; + } - foreach (DeRezObjectPacket.ObjectDataBlock data in - DeRezPacket.ObjectData) + 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; } -- cgit v1.1