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