Don't expose heartbeat to app

This commit is contained in:
Michael Bradley 2025-07-05 19:28:14 -04:00
parent e58629c2f1
commit 58795eb87e
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4
4 changed files with 7 additions and 6 deletions

View file

@ -26,7 +26,9 @@ pub fn handle_network_input(
.into());
}
let uuid = Uuid::from_slice(message.split_off(message.len() - 16).as_slice())?;
to_app.write(InboundPacket(Packet::new(message, uuid)));
if !message.is_empty() {
to_app.write(InboundPacket(Packet::new(message, uuid)));
}
if let Some(peer_id) = peer_map.get(&uuid) {
let (peer, mut last) = peers.get_mut(*peer_id)?;
last.update(&time);
@ -74,7 +76,7 @@ pub fn heartbeat(
}
}
pub fn timeouts(
pub fn timeout(
peers: Query<(&Peer, &PeerReceiveTiming)>,
time: Res<Time>,
mut delete: EventWriter<PeerChangeEvent>,