replace rkyv with serde and bincode

change to serde
This commit is contained in:
griffi-gh 2023-01-31 01:28:35 +01:00
parent b0642028d1
commit 1f5b5853b2
6 changed files with 25 additions and 14 deletions

View file

@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math", "rkyv"] } glam = { version = "0.22", features = ["debug-glam-assert", "fast-math", "serde"] }
strum = { version = "0.24", features = ["derive"] } strum = { version = "0.24", features = ["derive"] }
bincode = { version = "2.0.0-rc", default_features = false, features = ["std", "serde"] }
serde = { version = "1.0", features = ["derive"] }
bracket-noise = "0.8" bracket-noise = "0.8"
rkyv = { version = "0.7", features = ["validation", "archive_le"] }
bytecheck = "*"

View file

@ -1,3 +1 @@
pub mod client;
pub mod server;
pub mod messages; pub mod messages;

View file

@ -1,14 +1,27 @@
use rkyv::{Archive, Deserialize, Serialize}; use glam::{Vec3, Quat};
use bytecheck::CheckBytes; use serde::{Serialize, Deserialize};
#[derive(Archive, Deserialize, Serialize, Debug, PartialEq)] #[derive(Serialize, Deserialize)]
#[archive_attr(derive(CheckBytes, Debug))]
pub enum ClientToServerMessage { pub enum ClientToServerMessage {
Placeholder ClientHello {
username: String,
password: Option<String>,
},
PositionChanged {
position: Vec3,
direction: Quat
}
} }
#[derive(Archive, Deserialize, Serialize, Debug, PartialEq)] #[derive(Serialize, Deserialize)]
#[archive_attr(derive(CheckBytes, Debug))]
pub enum ServerToClientMessage { pub enum ServerToClientMessage {
Placeholder ServerHello {
client_id: u16,
},
ServerFuckOff {
reason: String,
},
PlayerPositionChanged {
},
} }

View file

@ -6,7 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
kubi-shared = { path = "../kubi-shared" } kubi-shared = { path = "../kubi-shared" }
glium = "0.32" glium = "0.32"
glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"] } glam = { version = "0.22", features = ["debug-glam-assert", "fast-math"] }
image = { version = "0.24", default_features = false, features = ["png"] } image = { version = "0.24", default_features = false, features = ["png"] }
log = "0.4" log = "0.4"
env_logger = "0.10" env_logger = "0.10"