Don't immediately send heartbeat
All checks were successful
CI / Formatting (push) Successful in 1m11s

This commit is contained in:
Michael Bradley 2025-07-05 18:09:46 -04:00
parent 591cfee715
commit e58629c2f1
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4
5 changed files with 50 additions and 46 deletions

View file

@ -4,11 +4,9 @@ use bevy::prelude::*;
use uuid::Uuid;
use super::{
io::{
Config, InboundPacket, OutboundPacket, handle_network_input, handle_network_output,
heartbeat, timeouts,
},
peer::{Peer, PeerChangeEvent, PeerMap, handle_peer_change},
io::{Config, handle_network_input, handle_network_output, heartbeat, timeouts},
packet::{InboundPacket, OutboundPacket},
peer::{Peer, PeerChangeEvent, PeerMap, handle_new_peer, handle_peer_change},
queues::{NetworkReceive, NetworkSend},
socket::bind_socket,
};
@ -42,7 +40,7 @@ impl Plugin for NetIOPlugin {
)
.add_systems(
FixedUpdate,
(heartbeat, timeouts).run_if(in_state(NetworkState::MultiPlayer)),
(heartbeat, timeouts, handle_new_peer).run_if(in_state(NetworkState::MultiPlayer)),
)
.add_systems(
FixedPostUpdate,