mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 08:18:43 -06:00
wip
This commit is contained in:
parent
4440b07bbe
commit
740fa04910
|
@ -38,7 +38,9 @@ pub fn authenticate_players(
|
|||
|
||||
//Approve the user
|
||||
server.0.send_message(*from, ServerToClientMessage::ServerHello {
|
||||
init: InitData {}
|
||||
init: InitData {
|
||||
users: todo!()
|
||||
}
|
||||
}).map_err(log_error).ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use std::num::NonZeroUsize;
|
||||
|
||||
use bincode::{Encode, Decode};
|
||||
use crate::chunk::BlockData;
|
||||
|
||||
|
@ -24,8 +26,17 @@ pub enum ClientToServerMessage {
|
|||
}
|
||||
|
||||
#[derive(Encode, Decode, Clone)]
|
||||
pub struct InitData {
|
||||
pub struct UserInitData {
|
||||
pub client_id: NonZeroUsize, //maybe use the proper type instead
|
||||
pub username: String,
|
||||
pub position: Vec3Arr,
|
||||
pub velocity: Vec3Arr,
|
||||
pub direction: QuatArr,
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Clone)]
|
||||
pub struct InitData {
|
||||
pub users: Vec<UserInitData>
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Clone)]
|
||||
|
|
|
@ -4,6 +4,7 @@ pub(crate) mod packet;
|
|||
pub(crate) mod common;
|
||||
pub use common::ClientId;
|
||||
pub use common::ClientIdRepr;
|
||||
pub use common::MAX_CLIENTS;
|
||||
|
||||
//pub(crate) trait Serializable: bincode::Encode + bincode::Decode {}
|
||||
pub(crate) const BINCODE_CONFIG: bincode::config::Configuration<bincode::config::LittleEndian, bincode::config::Varint, bincode::config::SkipFixedArrayLength> = bincode::config::standard()
|
||||
|
|
Loading…
Reference in a new issue