private void FlushPackets() { while (PacketQueue.Count > 0) { ServerPacket packet; if (PacketQueue.TryDequeue(out packet)) { if (packet.Header.HasFlag(PacketHeaderFlags.EncryptedChecksum) && ConnectionData.PacketSequence < 2) { ConnectionData.PacketSequence = 2; } packet.Header.Sequence = ConnectionData.PacketSequence++; packet.Header.Id = 0x0B; // This value is currently the hard coded Server ID. It can be something different... packet.Header.Table = 0x14; packet.Header.Time = (ushort)ConnectionData.ServerTime; if (packet.Header.Sequence >= 2u) { CachedPackets.TryAdd(packet.Header.Sequence, packet); } SendPacket(packet); } } }
private void FlushPackets() { while (PacketQueue.Count > 0) { ServerPacket packet; if (PacketQueue.TryDequeue(out packet)) { if (packet.Header.HasFlag(PacketHeaderFlags.EncryptedChecksum) && ConnectionData.PacketSequence < 2) { ConnectionData.PacketSequence = 2; } packet.Header.Sequence = ConnectionData.PacketSequence++; packet.Header.Id = (ushort)(connectionType == ConnectionType.Login ? 0x0B : 0x18); packet.Header.Table = 0x14; packet.Header.Time = (ushort)ConnectionData.ServerTime; if (packet.Header.Sequence >= 2u) { CachedPackets.TryAdd(packet.Header.Sequence, packet); } SendPacket(packet); } } }