634 netchan_new_t *chan = (netchan_new_t *)netchan;
635 uint32_t sequence, sequence_ack, reliable_ack;
636 qboolean reliable_message, fragmented_message, more_fragments;
637 uint16_t fragment_offset;
647 if (netchan->sock == NS_SERVER)
649 if (netchan->qport) {
653 reliable_message = sequence >> 31;
654 reliable_ack = sequence_ack >> 31;
655 fragmented_message = (sequence >> 30) & 1;
657 sequence &= 0x3FFFFFFF;
658 sequence_ack &= 0x3FFFFFFF;
661 more_fragments = qfalse;
662 if (fragmented_message) {
664 more_fragments = fragment_offset >> 15;
665 fragment_offset &= 0x7FFF;
668 SHOWPACKET(
"recv %4"PRIz
" : s=%d ack=%d rack=%d",
669 msg_read.cursize, sequence, sequence_ack, reliable_ack);
670 if (fragmented_message) {
671 SHOWPACKET(
" fragment_offset=%d more_fragments=%d",
672 fragment_offset, more_fragments);
674 if (reliable_message) {
675 SHOWPACKET(
" reliable=%d", chan->incoming_reliable_sequence ^ 1);
682 if (sequence <= netchan->incoming_sequence) {
683 SHOWDROP(
"%s: out of order packet %i at %i\n",
685 sequence, netchan->incoming_sequence);
692 netchan->dropped = sequence - (netchan->incoming_sequence + 1);
693 if (netchan->dropped > 0) {
694 SHOWDROP(
"%s: dropped %i packets at %i\n",
696 netchan->dropped, sequence);
703 chan->incoming_reliable_acknowledged = reliable_ack;
704 if (reliable_ack == chan->reliable_sequence) {
705 netchan->reliable_length = 0;
712 if (fragmented_message) {
713 if (chan->fragment_sequence != sequence) {
715 chan->fragment_sequence = sequence;
719 if (fragment_offset < chan->fragment_in.cursize) {
720 SHOWDROP(
"%s: out of order fragment at %i\n",
725 if (fragment_offset > chan->fragment_in.cursize) {
726 SHOWDROP(
"%s: dropped fragment(s) at %i\n",
732 if (chan->fragment_in.cursize + length > chan->fragment_in.maxsize) {
733 SHOWDROP(
"%s: oversize fragment at %i\n",
738 SZ_Write(&chan->fragment_in,
msg_read.data +
740 if (more_fragments) {
746 SZ_Write(&
msg_read, chan->fragment_in.data,
747 chan->fragment_in.cursize);
751 netchan->incoming_sequence = sequence;
752 netchan->incoming_acknowledged = sequence_ack;
757 if (reliable_message) {
758 netchan->reliable_ack_pending = qtrue;
759 chan->incoming_reliable_sequence ^= 1;
767 netchan->total_dropped += netchan->dropped;
768 netchan->total_received += netchan->dropped + 1;