From 1ba4b968638e8e8104102d9b2ba49e98c9bf2c20 Mon Sep 17 00:00:00 2001 From: Michael Bradley Date: Sat, 18 Oct 2025 17:30:31 -0400 Subject: [PATCH 1/4] Convert potential peer ping to a timer run condition --- src/net/heartbeat.rs | 34 +++++++--------------------------- src/net/plugin.rs | 12 ++++++++---- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/src/net/heartbeat.rs b/src/net/heartbeat.rs index 0d2f279..3e2003e 100644 --- a/src/net/heartbeat.rs +++ b/src/net/heartbeat.rs @@ -11,11 +11,9 @@ use super::{ queues::NetworkSend, }; -const PING_FREQUENCY: Duration = Duration::from_secs(3); -const MISSED_PINGS: u32 = 3; +pub const PING_FREQUENCY: Duration = Duration::from_secs(1); +const MISSED_PINGS: u32 = 5; -// TODO: Perhaps this needs a state rethink, is Single/Multiplayer actually useful vs Disconnected, Connecting, Connected? -// Would also help to state-scope some of these things, like InitialAddresses vs PeerMap pub fn heartbeat( peers: Query<(&PeerID, &PeerSendTiming)>, time: Res