Skip to content

fix: Avoid NaNs at very low latencies#469

Merged
elementbound merged 2 commits intomainfrom
fix/time-sync-nanms
Jun 13, 2025
Merged

fix: Avoid NaNs at very low latencies#469
elementbound merged 2 commits intomainfrom
fix/time-sync-nanms

Conversation

@elementbound
Copy link
Copy Markdown
Contributor

NetworkTimeSynchronizer samples the host's clock and takes a weighted average of the clock offsets, based on the roundtrip time. If the roundtrip time is very close to zero, the weight itself will zero, thus resulting in a division by zero. This value is then used to adjust the clock, setting it to NaN. This blocks the network tick loop.

To fix this, a check is added that will avoid the weighted average if the RTT is too low, and calculates a regular average instead.

Try the addon: netfox.v1.26.2.zip

@elementbound elementbound merged commit 26f548a into main Jun 13, 2025
2 checks passed
@elementbound elementbound deleted the fix/time-sync-nanms branch June 13, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant