Exemple #1
0
        public void ProcessInPacket(LLQueItem item)
        {
            Packet packet = item.Packet;

            // Always ack the packet!
            //
            if (packet.Header.Reliable)
            {
                AckPacket(packet);
            }

            if (packet.Type != PacketType.AgentUpdate)
            {
                m_PacketsReceived++;
            }

            PruneDupeTracker();

            // Check for duplicate packets..    packets that the client is
            // resending because it didn't receive our ack
            //
            lock (m_DupeTracker)
            {
                if (m_DupeTracker.ContainsKey(packet.Header.Sequence))
                {
                    return;
                }

                m_DupeTracker.Add(packet.Header.Sequence,
                                  Util.UnixTimeSinceEpoch());
            }

            m_Client.ProcessInPacket(packet);
        }
        public void ProcessInPacket(LLQueItem item)
        {
            Packet packet = item.Packet;

            // Always ack the packet!
            //
            if (packet.Header.Reliable)
            {
                AckPacket(packet);
            }

            if (packet.Type != PacketType.AgentUpdate)
            {
                m_PacketsReceived++;
            }

            // Check for duplicate packets..    packets that the client is
            // resending because it didn't receive our ack
            //
            lock (m_alreadySeenTracker)
            {
                ExpireSeenPackets();

                if (m_alreadySeenTracker.ContainsKey(packet.Header.Sequence))
                {
                    return;
                }

                m_alreadySeenTracker.Add(packet.Header.Sequence, Environment.TickCount & Int32.MaxValue);
                m_alreadySeenList.Add(packet.Header.Sequence);
            }

            m_Client.ProcessInPacket(packet);
        }