diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-24 12:43:42 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-24 12:43:42 +0200 |
commit | 9453f5f4b3e68d79fb09494b55bc885432ac0351 (patch) | |
tree | 66eea4b897cda02db1b72bbe305afcc6e4e8a4d8 /server/src/lib.rs | |
parent | f68d3a579f05e5bbe490cbaa9cc4d1e1bff208ac (diff) | |
download | hurrycurry-9453f5f4b3e68d79fb09494b55bc885432ac0351.tar hurrycurry-9453f5f4b3e68d79fb09494b55bc885432ac0351.tar.bz2 hurrycurry-9453f5f4b3e68d79fb09494b55bc885432ac0351.tar.zst |
format server in english locale
Diffstat (limited to 'server/src/lib.rs')
-rw-r--r-- | server/src/lib.rs | 69 |
1 files changed, 2 insertions, 67 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs index 69a9849e..5c7665c0 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -28,12 +28,13 @@ pub mod commands; pub mod data; pub mod entity; pub mod interaction; +pub mod message; pub mod network; pub mod scoreboard; pub mod server; pub mod state; -use hurrycurry_protocol::{glam::Vec2, Message}; +use hurrycurry_protocol::glam::Vec2; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ConnectionID(pub i64); @@ -52,69 +53,3 @@ impl InterpolateExt for f32 { *self = target + (*self - target) * (-dt).exp(); } } - -#[macro_export] -macro_rules! trm { - ($id:literal $(, $typ:ident = $param:expr)*) => { - hurrycurry_protocol::Message::Translation { - id: $id.to_owned(), - params: vec![$(crate::trm_param!($typ, $param)),*] - } - }; -} - -#[macro_export] -macro_rules! trm_param { - (s, $x:expr) => { - hurrycurry_protocol::Message::Text($x) - }; - (i, $x:expr) => { - hurrycurry_protocol::Message::Item($x) - }; - (t, $x:expr) => { - hurrycurry_protocol::Message::Tile($x) - }; - (m, $x:expr) => { - $x - }; -} - -#[derive(Debug)] -pub struct TrError { - pub id: &'static str, - pub params: Vec<Message>, -} -impl From<TrError> for Message { - fn from(value: TrError) -> Self { - Self::Translation { - id: value.id.to_owned(), - params: value.params, - } - } -} - -#[macro_export] -macro_rules! tre { - ($id:literal $(, $typ:ident = $param:expr)*) => { - crate::TrError { - id: $id, - params: vec![$(crate::tre_param!($typ, $param)),*] - } - }; -} - -#[macro_export] -macro_rules! tre_param { - (s, $x:expr) => { - hurrycurry_protocol::Message::Text($x) - }; - (i, $x:expr) => { - hurrycurry_protocol::Message::Item($x) - }; - (t, $x:expr) => { - hurrycurry_protocol::Message::Tile($x) - }; - (m, $x:expr) => { - $x - }; -} |