mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-25 05:08:21 -06:00
wip
This commit is contained in:
parent
539b6a1f91
commit
4a7c985ba1
|
@ -35,10 +35,12 @@ pub fn authenticate_players(
|
||||||
|
|
||||||
//Spawn the user
|
//Spawn the user
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
//Approve the user
|
//Approve the user
|
||||||
server.0.send_message(*from, ServerToClientMessage::ServerHello {
|
server.0.send_message(*from, ServerToClientMessage::ServerHello {
|
||||||
init: InitData {}
|
init: InitData {
|
||||||
|
users: todo!()
|
||||||
|
}
|
||||||
}).map_err(log_error).ok();
|
}).map_err(log_error).ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
use std::num::NonZeroUsize;
|
||||||
|
|
||||||
use bincode::{Encode, Decode};
|
use bincode::{Encode, Decode};
|
||||||
use crate::chunk::BlockData;
|
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)]
|
#[derive(Encode, Decode, Clone)]
|
||||||
pub struct InitData {
|
pub struct InitData {
|
||||||
|
pub users: Vec<UserInitData>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Encode, Decode, Clone)]
|
#[derive(Encode, Decode, Clone)]
|
||||||
|
|
|
@ -4,6 +4,7 @@ pub(crate) mod packet;
|
||||||
pub(crate) mod common;
|
pub(crate) mod common;
|
||||||
pub use common::ClientId;
|
pub use common::ClientId;
|
||||||
pub use common::ClientIdRepr;
|
pub use common::ClientIdRepr;
|
||||||
|
pub use common::MAX_CLIENTS;
|
||||||
|
|
||||||
//pub(crate) trait Serializable: bincode::Encode + bincode::Decode {}
|
//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()
|
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