diff options
author | Lee Salzman <[email protected]> | 2013-03-23 17:22:32 +0200 |
---|---|---|
committer | Lee Salzman <[email protected]> | 2013-03-23 17:22:32 +0200 |
commit | 714f40319ac4f92c9859753071e9341005e05dac (patch) | |
tree | 07f42561c21789e7c151266e7a0d284ac0425548 | |
parent | bf8187f2657d54fa13110c33d5ff5ba71ca3d524 (diff) | |
download | enet-714f40319ac4f92c9859753071e9341005e05dac.tar.gz enet-714f40319ac4f92c9859753071e9341005e05dac.zip |
set unused reliable sequence number field for acks to sane value
-rw-r--r-- | protocol.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1260,7 +1260,8 @@ enet_protocol_send_acknowledgements (ENetHost * host, ENetPeer * peer) ENetBuffer * buffer = & host -> buffers [host -> bufferCount]; ENetAcknowledgement * acknowledgement; ENetListIterator currentAcknowledgement; - + enet_uint16 reliableSequenceNumber; + currentAcknowledgement = enet_list_begin (& peer -> acknowledgements); while (currentAcknowledgement != enet_list_end (& peer -> acknowledgements)) @@ -1282,10 +1283,13 @@ enet_protocol_send_acknowledgements (ENetHost * host, ENetPeer * peer) buffer -> dataLength = sizeof (ENetProtocolAcknowledge); host -> packetSize += buffer -> dataLength; - + + reliableSequenceNumber = ENET_HOST_TO_NET_16 (acknowledgement -> command.header.reliableSequenceNumber); + command -> header.command = ENET_PROTOCOL_COMMAND_ACKNOWLEDGE; command -> header.channelID = acknowledgement -> command.header.channelID; - command -> acknowledge.receivedReliableSequenceNumber = ENET_HOST_TO_NET_16 (acknowledgement -> command.header.reliableSequenceNumber); + command -> header.reliableSequenceNumber = reliableSequenceNumber; + command -> acknowledge.receivedReliableSequenceNumber = reliableSequenceNumber; command -> acknowledge.receivedSentTime = ENET_HOST_TO_NET_16 (acknowledgement -> sentTime); if ((acknowledgement -> command.header.command & ENET_PROTOCOL_COMMAND_MASK) == ENET_PROTOCOL_COMMAND_DISCONNECT) |