diff --git a/src/game/net.rs b/src/game/net.rs index 2cde3b5..524b376 100644 --- a/src/game/net.rs +++ b/src/game/net.rs @@ -11,7 +11,6 @@ pub fn handle_new_peer( ) { if let Some(seed) = seed { for peer in new_peers { - warn!("Sending seed to peer: {}", peer.uuid); outbound.write(OutboundPacket(Packet::new((*seed).into(), peer.uuid))); } } diff --git a/src/net/io.rs b/src/net/io.rs index d02a3da..7dcceca 100644 --- a/src/net/io.rs +++ b/src/net/io.rs @@ -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