From ea03f968815f1af71b9f447836c231dd4f505d35 Mon Sep 17 00:00:00 2001 From: eihrul Date: Fri, 12 Oct 2007 17:37:31 +0000 Subject: *** empty log message *** --- peer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'peer.c') diff --git a/peer.c b/peer.c index 3bd3ba6..25f2a27 100644 --- a/peer.c +++ b/peer.c @@ -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)); -- cgit v1.2.3