diff options
author | eihrul <eihrul> | 2005-04-07 15:01:58 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2005-04-07 15:01:58 +0000 |
commit | 2ef761a8d25b5e79005fd25054090ccb2777317e (patch) | |
tree | 8f665d4f106b667ef2e48ffd08f9992c7453fe05 | |
parent | bd51177c6434b39bee3b7376ff7957d8c9c8db50 (diff) | |
download | enet-2ef761a8d25b5e79005fd25054090ccb2777317e.tar.gz enet-2ef761a8d25b5e79005fd25054090ccb2777317e.zip |
bug fixes
-rw-r--r-- | protocol.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -396,11 +396,11 @@ enet_protocol_handle_send_fragment (ENetHost * host, ENetPeer * peer, const ENet fragmentCount != startCommand -> fragmentCount) return; - if ((startCommand -> fragments [fragmentNumber / 32] & (1 << (fragmentNumber & 32))) == 0) + if ((startCommand -> fragments [fragmentNumber / 32] & (1 << (fragmentNumber % 32))) == 0) { -- startCommand -> fragmentsRemaining; - startCommand -> fragments [fragmentNumber / 32] |= (1 << (fragmentNumber & 32)); + startCommand -> fragments [fragmentNumber / 32] |= (1 << (fragmentNumber % 32)); if (fragmentOffset + fragmentLength > startCommand -> packet -> dataLength) fragmentLength = startCommand -> packet -> dataLength - fragmentOffset; @@ -1118,10 +1118,11 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch #ifdef ENET_DEBUG #ifdef WIN32 - printf ("peer %u: %f%%+-%f%% packet loss, %u+-%u ms round trip time, %f%% throttle, %u/%u outgoing, %u/%u incoming\n", currentPeer -> incomingPeerID, currentPeer -> packetLoss / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> packetLossVariance / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> roundTripTime, currentPeer -> roundTripTimeVariance, currentPeer -> packetThrottle / (float) ENET_PEER_PACKET_THROTTLE_SCALE, enet_list_size (& currentPeer -> outgoingReliableCommands), enet_list_size (& currentPeer -> outgoingUnreliableCommands), currentPeer -> channels != NULL ? enet_list_size (& currentPeer -> channels -> incomingReliableCommands) : 0, enet_list_size (& currentPeer -> channels -> incomingUnreliableCommands)); + printf ( #else - fprintf (stderr, "peer %u: %f%%+-%f%% packet loss, %u+-%u ms round trip time, %f%% throttle, %u/%u outgoing, %u/%u incoming\n", currentPeer -> incomingPeerID, currentPeer -> packetLoss / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> packetLossVariance / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> roundTripTime, currentPeer -> roundTripTimeVariance, currentPeer -> packetThrottle / (float) ENET_PEER_PACKET_THROTTLE_SCALE, enet_list_size (& currentPeer -> outgoingReliableCommands), enet_list_size (& currentPeer -> outgoingUnreliableCommands), currentPeer -> channels != NULL ? enet_list_size (& currentPeer -> channels -> incomingReliableCommands) : 0, enet_list_size (& currentPeer -> channels -> incomingUnreliableCommands)); + fprintf (stderr, #endif + "peer %u: %f%%+-%f%% packet loss, %u+-%u ms round trip time, %f%% throttle, %u/%u outgoing, %u/%u incoming\n", currentPeer -> incomingPeerID, currentPeer -> packetLoss / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> packetLossVariance / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> roundTripTime, currentPeer -> roundTripTimeVariance, currentPeer -> packetThrottle / (float) ENET_PEER_PACKET_THROTTLE_SCALE, enet_list_size (& currentPeer -> outgoingReliableCommands), enet_list_size (& currentPeer -> outgoingUnreliableCommands), currentPeer -> channels != NULL ? enet_list_size (& currentPeer -> channels -> incomingReliableCommands) : 0, enet_list_size (& currentPeer -> channels -> incomingUnreliableCommands)); #endif currentPeer -> packetLossVariance -= currentPeer -> packetLossVariance / 4; |