1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00

Read unknown packet data in more places

This commit is contained in:
Joshua Goins 2025-06-28 15:15:45 -04:00
parent ff3a7d6835
commit 41d8424615
3 changed files with 22 additions and 17 deletions

View file

@ -36,14 +36,14 @@ impl Default for ServerChatIpcSegment {
} }
#[binrw] #[binrw]
#[br(import(magic: &ServerChatIpcType, _size: &u32))] #[br(import(magic: &ServerChatIpcType, size: &u32))]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum ServerChatIpcData { pub enum ServerChatIpcData {
/// Sent by the server to Initialize something chat-related? /// Sent by the server to Initialize something chat-related?
#[br(pre_assert(*magic == ServerChatIpcType::LoginReply))] #[br(pre_assert(*magic == ServerChatIpcType::LoginReply))]
LoginReply { LoginReply { timestamp: u32, sid: u32 },
timestamp: u32, Unknown {
sid: u32, #[br(count = size - 32)]
unk: Vec<u8>,
}, },
Unknown,
} }

View file

@ -83,7 +83,7 @@ impl Default for ServerLobbyIpcSegment {
} }
#[binrw] #[binrw]
#[br(import(magic: &ClientLobbyIpcType, _size: &u32))] #[br(import(magic: &ClientLobbyIpcType, size: &u32))]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum ClientLobbyIpcData { pub enum ClientLobbyIpcData {
/// Sent by the client when it requests the character list in the lobby. /// Sent by the client when it requests the character list in the lobby.
@ -127,11 +127,14 @@ pub enum ClientLobbyIpcData {
/// Sent by the client when they request something about the character (e.g. deletion.) /// Sent by the client when they request something about the character (e.g. deletion.)
#[br(pre_assert(*magic == ClientLobbyIpcType::CharaMake))] #[br(pre_assert(*magic == ClientLobbyIpcType::CharaMake))]
CharaMake(CharaMake), CharaMake(CharaMake),
Unknown, Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
},
} }
#[binrw] #[binrw]
#[br(import(magic: &ServerLobbyIpcType, _size: &u32))] #[br(import(magic: &ServerLobbyIpcType, size: &u32))]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum ServerLobbyIpcData { pub enum ServerLobbyIpcData {
/// Sent by the server to indicate an lobby error occured. /// Sent by the server to indicate an lobby error occured.
@ -194,7 +197,10 @@ pub enum ServerLobbyIpcData {
#[brw(pad_after = 202)] #[brw(pad_after = 202)]
unk1: u8, unk1: u8,
}, },
Unknown, Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
},
} }
#[cfg(test)] #[cfg(test)]

View file

@ -149,7 +149,7 @@ impl Default for ServerZoneIpcSegment {
} }
#[binrw] #[binrw]
#[br(import(magic: &ServerZoneIpcType, _size: &u32))] #[br(import(magic: &ServerZoneIpcType, size: &u32))]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum ServerZoneIpcData { pub enum ServerZoneIpcData {
/// Sent by the server as response to ZoneInitRequest. /// Sent by the server as response to ZoneInitRequest.
@ -211,14 +211,10 @@ pub enum ServerZoneIpcData {
}, },
/// Unknown, but seems to contain information on cross-world linkshells /// Unknown, but seems to contain information on cross-world linkshells
#[br(pre_assert(*magic == ServerZoneIpcType::LinkShellInformation))] #[br(pre_assert(*magic == ServerZoneIpcType::LinkShellInformation))]
LinkShellInformation { LinkShellInformation { unk: [u8; 456] },
unk: [u8; 456],
},
/// Sent by the server when it wants the client to... prepare to zone? /// Sent by the server when it wants the client to... prepare to zone?
#[br(pre_assert(*magic == ServerZoneIpcType::PrepareZoning))] #[br(pre_assert(*magic == ServerZoneIpcType::PrepareZoning))]
PrepareZoning { PrepareZoning { unk: [u32; 4] },
unk: [u32; 4],
},
/// Sent by the server /// Sent by the server
#[br(pre_assert(*magic == ServerZoneIpcType::ActorControl))] #[br(pre_assert(*magic == ServerZoneIpcType::ActorControl))]
ActorControl(ActorControl), ActorControl(ActorControl),
@ -308,7 +304,10 @@ pub enum ServerZoneIpcData {
#[brw(pad_after = 26)] #[brw(pad_after = 26)]
unk2: u16, unk2: u16,
}, },
Unknown, Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
},
} }
#[binrw] #[binrw]