From 1dd10f892f4742498a99a0bb5d9b1f8f6e94f26b Mon Sep 17 00:00:00 2001 From: Glenn Fiedler Date: Wed, 17 Apr 2019 15:06:33 -0700 Subject: [PATCH] whoops I screwed up the replay protection fix. --- netcode.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/netcode.c b/netcode.c index a6bb830..3fdedd1 100755 --- a/netcode.c +++ b/netcode.c @@ -1669,9 +1669,6 @@ 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 ) @@ -1679,8 +1676,6 @@ int netcode_replay_protection_already_received( struct netcode_replay_protection 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,