Skip to content
Permalink
Browse files

whoops I screwed up the replay protection fix.

  • Loading branch information...
gafferongames committed Apr 17, 2019
1 parent b5173ce commit 1dd10f892f4742498a99a0bb5d9b1f8f6e94f26b
Showing with 1 addition and 9 deletions.
  1. +1 −9 netcode.c
@@ -1669,18 +1669,13 @@ int netcode_replay_protection_already_received( struct netcode_replay_protection
if ( sequence + NETCODE_REPLAY_PROTECTION_BUFFER_SIZE <= replay_protection->most_recent_sequence )
return 1;

if ( sequence > replay_protection->most_recent_sequence )
replay_protection->most_recent_sequence = sequence;

int index = (int) ( sequence % NETCODE_REPLAY_PROTECTION_BUFFER_SIZE );

if ( replay_protection->received_packet[index] == 0xFFFFFFFFFFFFFFFFLL )
return 0;

if ( replay_protection->received_packet[index] >= sequence )
return 1;

replay_protection->received_packet[index] = sequence;

return 0;
}
@@ -1694,10 +1689,7 @@ void netcode_replay_protection_advance_sequence( struct netcode_replay_protectio

int index = (int) ( sequence % NETCODE_REPLAY_PROTECTION_BUFFER_SIZE );

if ( replay_protection->received_packet[index] == 0xFFFFFFFFFFFFFFFFLL )
{
replay_protection->received_packet[index] = sequence;
}
replay_protection->received_packet[index] = sequence;
}

void * netcode_read_packet( uint8_t * buffer,

0 comments on commit 1dd10f8

Please sign in to comment.
You can’t perform that action at this time.