Added packets folder for the packet-service until I automate generation at build time

This commit is contained in:
2025-07-23 13:59:08 -04:00
parent f10cac3794
commit d39e3405bb
200 changed files with 12512 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
/* This file is @generated with IDL v0.2.2 */
use crate::dataconsts::*;
use crate::enums::*;
use crate::packet::PacketPayload;
use crate::types::*;
use bincode::de::read::Reader;
use bincode::enc::write::Writer;
use bincode::{de::Decoder, enc::Encoder, error::DecodeError, Decode, Encode};
use utils::null_string::NullTerminatedString;
#[derive(Debug)]
pub struct CliWhisperChat {
pub(crate) target: NullTerminatedString,
pub(crate) message: NullTerminatedString,
}
impl PacketPayload for CliWhisperChat {}
impl Encode for CliWhisperChat {
fn encode<E: Encoder>(&self, encoder: &mut E) -> std::result::Result<(), bincode::error::EncodeError> {
self.target.encode(encoder)?;
self.message.encode(encoder)?;
Ok(())
}
}
impl<Context> Decode<Context> for CliWhisperChat {
fn decode<D: Decoder>(decoder: &mut D) -> std::result::Result<Self, bincode::error::DecodeError> {
let target = NullTerminatedString::decode(decoder)?;
let message = NullTerminatedString::decode(decoder)?;
Ok(Self { target, message })
}
}