persistence + proper disconnect

This commit is contained in:
2025-11-28 17:29:33 -05:00
parent 029d62cb53
commit 7557507f27
16 changed files with 413 additions and 67 deletions

View File

@@ -11,20 +11,20 @@ pub const BINCODE_CONFIG: Configuration = bincode::config::standard();
#[derive(Debug, bincode::Encode, bincode::Decode)]
pub enum ClientMsg {
SendMsg(Msg),
SendMsg(NetMsg),
RequestMsgs,
}
#[derive(Debug, bincode::Encode, bincode::Decode)]
pub enum ServerMsg {
SendMsg(Msg),
LoadMsgs(Vec<Msg>),
SendMsg(NetMsg),
LoadMsgs(Vec<NetMsg>),
}
pub type ServerResp<T> = Result<T, String>;
#[derive(Debug, Clone, bincode::Encode, bincode::Decode)]
pub struct Msg {
pub struct NetMsg {
pub content: String,
pub user: String,
}