From: Lizzy Fleckenstein Date: Mon, 13 Feb 2023 13:15:57 +0000 (+0100) Subject: Fix Field sending X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=8ab53c90bc14adcc38eeb324711b8afdc434eb55;p=mt_net.git Fix Field sending --- diff --git a/src/to_srv.rs b/src/to_srv.rs index ce5282c..321138c 100644 --- a/src/to_srv.rs +++ b/src/to_srv.rs @@ -43,6 +43,23 @@ pub enum PointedThing { Obj { obj: u16 }, } +#[mt_derive(to = "srv")] +pub struct String32(#[mt(len32)] pub String); + +impl std::ops::Deref for String32 { + type Target = String; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl std::ops::DerefMut for String32 { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + #[mt_derive(to = "srv", repr = "u16", tag = "type", content = "data")] pub enum ToSrvPkt { Nil = 0, @@ -105,11 +122,11 @@ pub enum ToSrvPkt { NodeMetaFields { pos: [i16; 3], formname: String, - fields: HashMap, + fields: HashMap, } = 59, InvFields { formname: String, - fields: HashMap, + fields: HashMap, } = 60, ReqMedia { filenames: Vec,