Esempio n. 1
0
        public void processReadPackets()
        {
            if (sendQueueByteLength > 0x100000)
            {
                networkShutdown("disconnect.overflow", new object[0]);
            }
            if (readPackets.isEmpty())
            {
                if (timeSinceLastRead++ == 1200)
                {
                    networkShutdown("disconnect.timeout", new object[0]);
                }
            }
            else
            {
                timeSinceLastRead = 0;
            }
            Packet packet;

            for (int i = 100; !readPackets.isEmpty() && i-- >= 0; packet.processPacket(netHandler))
            {
                packet = (Packet)readPackets.remove(0);
            }

            if (isTerminating && readPackets.isEmpty())
            {
                netHandler.handleErrorMessage(terminationReason, field_20176_t);
            }
        }