From 05f909497cd0670f5ee4e62c6a4b875d30733784 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 26 Jun 2025 21:06:54 -0400 Subject: [PATCH] More unknown IPC handling fixes --- src/bin/kawari-lobby.rs | 1 + src/bin/kawari-world.rs | 1 + src/ipc/chat/mod.rs | 9 +++++++-- src/ipc/lobby/mod.rs | 11 ++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/bin/kawari-lobby.rs b/src/bin/kawari-lobby.rs index 2d46763..93f5c4f 100644 --- a/src/bin/kawari-lobby.rs +++ b/src/bin/kawari-lobby.rs @@ -174,6 +174,7 @@ async fn main() { .send_enter_world(*sequence, *content_id, our_actor_id) .await; } + _ => {} }, SegmentData::KeepAliveRequest { id, timestamp } => { send_keep_alive::( diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index b83cb54..f37a642 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -923,6 +923,7 @@ async fn client_loop( }) .await; } + _ => {}, } } SegmentData::KeepAliveRequest { id, timestamp } => { diff --git a/src/ipc/chat/mod.rs b/src/ipc/chat/mod.rs index 53c0adf..a57ff82 100644 --- a/src/ipc/chat/mod.rs +++ b/src/ipc/chat/mod.rs @@ -36,9 +36,14 @@ impl Default for ServerChatIpcSegment { } #[binrw] -#[br(import(_magic: &ServerChatIpcType))] +#[br(import(magic: &ServerChatIpcType))] #[derive(Debug, Clone)] pub enum ServerChatIpcData { /// Sent by the server to Initialize something chat-related? - LoginReply { timestamp: u32, sid: u32 }, + #[br(pre_assert(*magic == ServerChatIpcType::LoginReply))] + LoginReply { + timestamp: u32, + sid: u32, + }, + Unknown, } diff --git a/src/ipc/lobby/mod.rs b/src/ipc/lobby/mod.rs index cee3663..814cce7 100644 --- a/src/ipc/lobby/mod.rs +++ b/src/ipc/lobby/mod.rs @@ -127,13 +127,15 @@ pub enum ClientLobbyIpcData { /// Sent by the client when they request something about the character (e.g. deletion.) #[br(pre_assert(*magic == ClientLobbyIpcType::CharaMake))] CharaMake(CharaMake), + Unknown, } #[binrw] -#[br(import(_magic: &ServerLobbyIpcType))] +#[br(import(magic: &ServerLobbyIpcType))] #[derive(Debug, Clone)] pub enum ServerLobbyIpcData { /// Sent by the server to indicate an lobby error occured. + #[br(pre_assert(*magic == ServerLobbyIpcType::NackReply))] NackReply { sequence: u64, error: u32, @@ -143,10 +145,13 @@ pub enum ServerLobbyIpcData { unk1: u16, }, /// Sent by the server to inform the client of their service accounts. + #[br(pre_assert(*magic == ServerLobbyIpcType::LoginReply))] LoginReply(LoginReply), /// Sent by the server to inform the client of their characters. + #[br(pre_assert(*magic == ServerLobbyIpcType::ServiceLoginReply))] ServiceLoginReply(ServiceLoginReply), // Assumed what this is, but probably incorrect + #[br(pre_assert(*magic == ServerLobbyIpcType::CharaMakeReply))] CharaMakeReply { sequence: u64, unk1: u8, @@ -158,6 +163,7 @@ pub enum ServerLobbyIpcData { details: CharacterDetails, }, /// Sent by the server to tell the client how to connect to the world server. + #[br(pre_assert(*magic == ServerLobbyIpcType::GameLoginReply))] GameLoginReply { sequence: u64, actor_id: u32, @@ -178,14 +184,17 @@ pub enum ServerLobbyIpcData { host: String, }, /// Sent by the server to inform the client of their servers. + #[br(pre_assert(*magic == ServerLobbyIpcType::DistWorldInfo))] DistWorldInfo(DistWorldInfo), /// Sent by the server to inform the client of their retainers. + #[br(pre_assert(*magic == ServerLobbyIpcType::DistRetainerInfo))] DistRetainerInfo { // TODO: what is in here? #[brw(pad_before = 7)] #[brw(pad_after = 202)] unk1: u8, }, + Unknown, } #[cfg(test)]