mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-21 22:38:41 -06:00
wip
This commit is contained in:
parent
4440b07bbe
commit
740fa04910
|
@ -35,10 +35,12 @@ pub fn authenticate_players(
|
|||
|
||||
//Spawn the user
|
||||
// TODO
|
||||
|
||||
|
||||
//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;
|
||||
|
||||
|
@ -23,9 +25,18 @@ pub enum ClientToServerMessage {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Clone)]
|
||||
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