From 7c1a3944e9db85a73a54d55f6c6717faa329efe6 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 12 Mar 2025 19:45:15 -0400 Subject: [PATCH] Add more fields to ChatMessage IPC --- src/bin/kawari-world.rs | 2 +- src/ipc.rs | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index 44f6cc3..5191a44 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -450,7 +450,7 @@ async fn main() { IPCStructData::Disconnected { .. } => { tracing::info!("Client disconnected!"); } - IPCStructData::ChatMessage { message } => { + IPCStructData::ChatMessage { message, .. } => { tracing::info!("Client sent chat message: {message}!"); } _ => panic!( diff --git a/src/ipc.rs b/src/ipc.rs index b0f1537..06ffc93 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -280,9 +280,15 @@ pub enum IPCStructData { #[br(pre_assert(*magic == IPCOpCode::ChatMessage))] ChatMessage { // TODO: incomplete - #[br(dbg)] - #[brw(pad_before = 26)] - #[brw(pad_after = 998)] + #[brw(pad_before = 4)] // empty + player_id: u32, + + #[brw(pad_before = 4)] // empty + timestamp: u32, + + #[brw(pad_before = 8)] // NOT empty + channel: u16, + #[br(count = 32)] #[bw(pad_size_to = 32)] #[br(map = read_string)] @@ -447,7 +453,7 @@ impl IPCSegment { IPCStructData::LogOut { .. } => todo!(), IPCStructData::LogOutComplete { .. } => 8, IPCStructData::Disconnected { .. } => todo!(), - IPCStructData::ChatMessage { .. } => todo!(), + IPCStructData::ChatMessage { .. } => 1056, } } }