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
[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"] }
bincode = { version = "2.0.0-rc", default_features = false, features = ["std", "serde"] }
serde = { version = "1.0", features = ["derive"] }
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;

View file

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

View file

@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
kubi-shared = { path = "../kubi-shared" }
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"] }
log = "0.4"
env_logger = "0.10"