Don't immediately send heartbeat
All checks were successful
CI / Formatting (push) Successful in 1m11s
All checks were successful
CI / Formatting (push) Successful in 1m11s
This commit is contained in:
parent
591cfee715
commit
e58629c2f1
5 changed files with 50 additions and 46 deletions
20
src/net/packet.rs
Normal file
20
src/net/packet.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use bevy::prelude::*;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Packet {
|
||||
pub message: Vec<u8>,
|
||||
pub peer: Uuid,
|
||||
}
|
||||
|
||||
impl Packet {
|
||||
pub fn new(message: Vec<u8>, peer: Uuid) -> Self {
|
||||
Self { peer, message }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Event)]
|
||||
pub struct OutboundPacket(pub Packet);
|
||||
|
||||
#[derive(Debug, Event)]
|
||||
pub struct InboundPacket(pub Packet);
|
||||
Loading…
Add table
Add a link
Reference in a new issue