From 3e6aa433b466b3d441af13fd1f411b046e5ca434 Mon Sep 17 00:00:00 2001 From: Glenn Fiedler Date: Tue, 17 Sep 2024 07:03:43 -0400 Subject: [PATCH] fix derp --- reliable.c | 2 +- stats.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/reliable.c b/reliable.c index 825d99f..14d4c53 100644 --- a/reliable.c +++ b/reliable.c @@ -1392,7 +1392,7 @@ void reliable_endpoint_update( struct reliable_endpoint_t * endpoint, double tim { if ( endpoint->rtt_history_buffer[i] >= 0.0f ) { - sum += endpoint->rtt_history_buffer[i]; + sum += ( endpoint->rtt_history_buffer[i] - endpoint->rtt_min ); count++; } } diff --git a/stats.c b/stats.c index d786ee5..f601550 100644 --- a/stats.c +++ b/stats.c @@ -217,11 +217,10 @@ void stats_iteration( double time ) float sent_bandwidth_kbps, received_bandwidth_kbps, acked_bandwidth_kbps; reliable_endpoint_bandwidth( global_context.client, &sent_bandwidth_kbps, &received_bandwidth_kbps, &acked_bandwidth_kbps ); - printf( "%" PRIi64 " sent | %" PRIi64 " received | %" PRIi64 " acked | rtt avg = %dms | rtt min = %dms | jitter = %dms | packet loss = %d%% | sent = %dkbps | recv = %dkbps | acked = %dkbps\n", + printf( "%" PRIi64 " sent | %" PRIi64 " received | %" PRIi64 " acked | rtt = %dms | jitter = %dms | packet loss = %d%% | sent = %dkbps | recv = %dkbps | acked = %dkbps\n", counters[RELIABLE_ENDPOINT_COUNTER_NUM_PACKETS_SENT], counters[RELIABLE_ENDPOINT_COUNTER_NUM_PACKETS_RECEIVED], counters[RELIABLE_ENDPOINT_COUNTER_NUM_PACKETS_ACKED], - (int) reliable_endpoint_rtt( global_context.client ), (int) reliable_endpoint_rtt_min( global_context.client ), (int) reliable_endpoint_jitter( global_context.client ), (int) ( reliable_endpoint_packet_loss( global_context.client ) + 0.5f ),