diff options
author | Lee Salzman <[email protected]> | 2020-08-23 16:35:43 -0400 |
---|---|---|
committer | Lee Salzman <[email protected]> | 2020-08-23 16:35:43 -0400 |
commit | 8d55487767bbd9d49e97d325579d7b6a6fab50b6 (patch) | |
tree | b3253799d3ad6c60e188ed137645968cea886736 | |
parent | 5de0a6f7646d3aaf8273989ddc4652f6aac880b2 (diff) | |
download | enet-8d55487767bbd9d49e97d325579d7b6a6fab50b6.tar.gz enet-8d55487767bbd9d49e97d325579d7b6a6fab50b6.zip |
make throttle more readily accelerate
-rw-r--r-- | peer.c | 2 | ||||
-rw-r--r-- | protocol.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -66,7 +66,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt) peer -> packetThrottle = peer -> packetThrottleLimit; } else - if (rtt <= peer -> lastRoundTripTime) + if (rtt <= peer -> lastRoundTripTime + (peer -> lastRoundTripTimeVariance + 1) / 2) { peer -> packetThrottle += peer -> packetThrottleAcceleration; @@ -888,7 +888,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> packetThrottleEpoch) >= peer -> packetThrottleInterval) { peer -> lastRoundTripTime = peer -> lowestRoundTripTime; - peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, (peer -> lowestRoundTripTime + 23) / 24); + peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, (peer -> lowestRoundTripTime + 15) / 16); peer -> lowestRoundTripTime = peer -> roundTripTime; peer -> highestRoundTripTimeVariance = peer -> roundTripTimeVariance; peer -> packetThrottleEpoch = host -> serviceTime; |