diff options
author | eihrul <eihrul> | 2007-10-12 17:37:31 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2007-10-12 17:37:31 +0000 |
commit | ea03f968815f1af71b9f447836c231dd4f505d35 (patch) | |
tree | 7abcaab22bc8dc6fa48f42e7aeab887b2c91a0ce /peer.c | |
parent | e1bafe24253a0543ef7ba64542c6b098f79f3e7f (diff) | |
download | enet-ea03f968815f1af71b9f447836c231dd4f505d35.tar.gz enet-ea03f968815f1af71b9f447836c231dd4f505d35.zip |
*** empty log message ***
Diffstat (limited to 'peer.c')
-rw-r--r-- | peer.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -473,6 +473,19 @@ enet_peer_queue_acknowledgement (ENetPeer * peer, const ENetProtocol * command, { ENetAcknowledgement * acknowledgement; + if (command -> header.channelID < peer -> channelCount) + { + ENetChannel * channel = & peer -> channels [command -> header.channelID]; + enet_uint16 reliableWindow = command -> header.reliableSequenceNumber / ENET_PEER_RELIABLE_WINDOW_SIZE, + currentWindow = channel -> incomingReliableSequenceNumber / ENET_PEER_RELIABLE_WINDOW_SIZE; + + if (reliableWindow < currentWindow) + reliableWindow += ENET_PEER_RELIABLE_WINDOWS; + + if (reliableWindow < currentWindow || reliableWindow >= currentWindow + ENET_PEER_FREE_RELIABLE_WINDOWS) + return NULL; + } + peer -> outgoingDataTotal += sizeof (ENetProtocolAcknowledge); acknowledgement = (ENetAcknowledgement *) enet_malloc (sizeof (ENetAcknowledgement)); |