From 343b307aa696a4f532704bb239c4e9c853c9801b Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Mon, 30 Jan 2023 20:23:00 +0100 Subject: [PATCH] CheckBytes --- kubi-shared/Cargo.toml | 1 + kubi-shared/src/networking/messages.rs | 3 +++ kubi/src/world/block.rs | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kubi-shared/Cargo.toml b/kubi-shared/Cargo.toml index ff834cc..73c42a5 100644 --- a/kubi-shared/Cargo.toml +++ b/kubi-shared/Cargo.toml @@ -10,3 +10,4 @@ glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math", strum = { version = "0.24", features = ["derive"] } bracket-noise = "0.8" rkyv = { version = "0.7", features = ["validation", "archive_le"] } +bytecheck = "*" diff --git a/kubi-shared/src/networking/messages.rs b/kubi-shared/src/networking/messages.rs index ba01e36..b0734e5 100644 --- a/kubi-shared/src/networking/messages.rs +++ b/kubi-shared/src/networking/messages.rs @@ -1,11 +1,14 @@ use rkyv::{Archive, Deserialize, Serialize}; +use bytecheck::CheckBytes; #[derive(Archive, Deserialize, Serialize, Debug, PartialEq)] +#[archive_attr(derive(CheckBytes, Debug))] pub enum ClientToServerMessage { Placeholder } #[derive(Archive, Deserialize, Serialize, Debug, PartialEq)] +#[archive_attr(derive(CheckBytes, Debug))] pub enum ServerToClientMessage { Placeholder } diff --git a/kubi/src/world/block.rs b/kubi/src/world/block.rs index 1ece14c..45c2552 100644 --- a/kubi/src/world/block.rs +++ b/kubi/src/world/block.rs @@ -1,4 +1,3 @@ -use strum::EnumIter; use crate::prefabs::BlockTexture; pub use kubi_shared::blocks::Block;