mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-01 04:07:45 +00:00
These were kind of scattered everywhere, instead we should move them into their own module. Kawari's custom IPC is moved here too.
23 lines
480 B
Rust
23 lines
480 B
Rust
use binrw::binrw;
|
|
|
|
use crate::common::{read_string, write_string};
|
|
|
|
#[binrw]
|
|
#[derive(Debug, Clone, Default)]
|
|
pub struct ChatMessage {
|
|
// TODO: incomplete
|
|
#[brw(pad_before = 4)] // empty
|
|
pub player_id: u32,
|
|
|
|
#[brw(pad_before = 4)] // empty
|
|
pub timestamp: u32,
|
|
|
|
#[brw(pad_before = 8)] // NOT empty
|
|
pub channel: u16,
|
|
|
|
#[br(count = 32)]
|
|
#[bw(pad_size_to = 32)]
|
|
#[br(map = read_string)]
|
|
#[bw(map = write_string)]
|
|
pub message: String,
|
|
}
|