kubi/kubi-shared/src/networking/messages.rs

31 lines
506 B
Rust
Raw Normal View History

use glam::{Vec3, Quat};
use serde::{Serialize, Deserialize};
2023-01-29 20:42:58 -06:00
#[derive(Serialize, Deserialize)]
2023-01-29 20:42:58 -06:00
pub enum ClientToServerMessage {
ClientHello {
username: String,
password: Option<String>,
},
PositionChanged {
2023-01-30 19:23:44 -06:00
client_id: u8,
secret: u32,
position: Vec3,
direction: Quat
}
2023-01-29 20:42:58 -06:00
}
#[derive(Serialize, Deserialize)]
2023-01-29 20:42:58 -06:00
pub enum ServerToClientMessage {
ServerHello {
2023-01-30 19:23:44 -06:00
client_id: u8,
secret: u32,
},
ServerFuckOff {
reason: String,
},
PlayerPositionChanged {
},
2023-01-29 20:42:58 -06:00
}