steel_protocol/packets/game/chat/
message.rs1use std::io::Cursor;
2
3use steel_macros::{ReadFrom, ServerPacket};
4use steel_utils::codec::VarInt;
5
6#[derive(ReadFrom, ServerPacket, Clone, Debug)]
7pub struct SChat {
8 #[read(as = Prefixed(VarInt), bound = 256)]
9 pub message: String,
10
11 pub timestamp: i64,
12
13 pub salt: i64,
14
15 pub signature: Option<[u8; 256]>,
16
17 #[read(as = VarInt)]
18 pub offset: i32,
19
20 pub acknowledged: [u8; 3],
21
22 pub checksum: u8,
23}
24
25#[derive(ServerPacket, Clone, Debug)]
32pub struct SChatAck {
33 pub offset: VarInt,
35}
36
37impl steel_utils::serial::ReadFrom for SChatAck {
38 fn read(reader: &mut Cursor<&[u8]>) -> std::io::Result<Self> {
39 Ok(Self {
40 offset: VarInt::read(reader)?,
41 })
42 }
43}