1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 03:37: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]
#[br(import(magic: &ServerChatIpcType, _size: &u32))]
#[br(import(magic: &ServerChatIpcType, size: &u32))]
#[derive(Debug, Clone)]
pub enum ServerChatIpcData {
/// Sent by the server to Initialize something chat-related?
#[br(pre_assert(*magic == ServerChatIpcType::LoginReply))]
LoginReply {
timestamp: u32,
sid: u32,
LoginReply { timestamp: u32, sid: u32 },
Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
},
Unknown,
}

View file

@ -83,7 +83,7 @@ impl Default for ServerLobbyIpcSegment {
}
#[binrw]
#[br(import(magic: &ClientLobbyIpcType, _size: &u32))]
#[br(import(magic: &ClientLobbyIpcType, size: &u32))]
#[derive(Debug, Clone)]
pub enum ClientLobbyIpcData {
/// 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.)
#[br(pre_assert(*magic == ClientLobbyIpcType::CharaMake))]
CharaMake(CharaMake),
Unknown,
Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
},
}
#[binrw]
#[br(import(magic: &ServerLobbyIpcType, _size: &u32))]
#[br(import(magic: &ServerLobbyIpcType, size: &u32))]
#[derive(Debug, Clone)]
pub enum ServerLobbyIpcData {
/// Sent by the server to indicate an lobby error occured.
@ -194,7 +197,10 @@ pub enum ServerLobbyIpcData {
#[brw(pad_after = 202)]
unk1: u8,
},
Unknown,
Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
},
}
#[cfg(test)]

View file

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