1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-23 21:17:45 +00:00

Fix various social list related IPC opcodes

These aren't perfect yet, I need to fix some of the wrong padding
inside of them.
This commit is contained in:
Joshua Goins 2025-07-21 23:25:51 -04:00
parent de645008c7
commit 2acbfe6df8
3 changed files with 41 additions and 19 deletions

View file

@ -93,11 +93,11 @@
{
"name": "Unk17",
"opcode": 777,
"size": 104
"size": 968
},
{
"name": "SocialList",
"opcode": 253,
"opcode": 152,
"size": 1136
},
{
@ -329,6 +329,11 @@
"name": "CrossworldLinkshells",
"opcode": 709,
"size": 456
},
{
"name": "SetSearchComment",
"opcode": 512,
"size": 216
}
],
"ClientZoneIpcType": [
@ -347,11 +352,6 @@
"opcode": 531,
"size": 32
},
{
"name": "Unk2",
"opcode": 968,
"size": 16
},
{
"name": "Unk3",
"opcode": 253,
@ -374,7 +374,7 @@
},
{
"name": "SocialListRequest",
"opcode": 604,
"opcode": 968,
"size": 16
},
{

View file

@ -570,6 +570,22 @@ pub enum ServerZoneIpcData {
// TODO: fill this out, each entry is 57 bytes probably
unk1: [u8; 456],
},
#[br(pre_assert(*magic == ServerZoneIpcType::SetSearchComment))]
SetSearchComment {
// TODO: fill this out
unk1: [u8; 18],
#[brw(pad_size_to = 32)]
#[br(count = 32)]
#[br(map = read_string)]
#[bw(map = write_string)]
comment: String,
unk2: [u8; 166],
},
#[br(pre_assert(*magic == ServerZoneIpcType::Unk17))]
Unk17 {
// TODO: fill this out
unk1: [u8; 968],
},
Unknown {
#[br(count = size - 32)]
unk: Vec<u8>,
@ -603,12 +619,6 @@ pub enum ClientZoneIpcData {
},
#[br(pre_assert(*magic == ClientZoneIpcType::ClientTrigger))]
ClientTrigger(ClientTrigger),
/// FIXME: 16 bytes of something from the client, not sure what yet
#[br(pre_assert(*magic == ClientZoneIpcType::Unk2))]
Unk2 {
// TODO: full of possibly interesting information
unk: [u8; 16],
},
/// FIXME: 8 bytes of something from the client, not sure what yet
#[br(pre_assert(*magic == ClientZoneIpcType::Unk3))]
Unk3 {
@ -1139,6 +1149,18 @@ mod tests {
status_effects: [StatusEffect::default(); 30],
},
),
(
ServerZoneIpcType::SetSearchComment,
ServerZoneIpcData::SetSearchComment {
unk1: [0; 18],
comment: String::default(),
unk2: [0; 166],
},
),
(
ServerZoneIpcType::Unk17,
ServerZoneIpcData::Unk17 { unk1: [0; 968] },
),
];
for (opcode, data) in &ipc_types {
@ -1184,10 +1206,6 @@ mod tests {
ClientZoneIpcType::ClientTrigger,
ClientZoneIpcData::ClientTrigger(ClientTrigger::default()),
),
(
ClientZoneIpcType::Unk2,
ClientZoneIpcData::Unk2 { unk: [0; 16] },
),
(
ClientZoneIpcType::Unk3,
ClientZoneIpcData::Unk3 { unk: [0; 8] },

View file

@ -47,6 +47,10 @@ pub struct PlayerEntry {
pub fc_tag: String,
}
impl PlayerEntry {
pub const SIZE: usize = 112;
}
#[binrw]
#[derive(Debug, Clone, Default)]
pub struct SocialList {
@ -55,6 +59,6 @@ pub struct SocialList {
pub sequence: u8,
#[brw(pad_before = 2)] // empty
#[br(count = 10)]
#[bw(pad_size_to = 112 * 10)]
#[bw(pad_size_to = 10 * PlayerEntry::SIZE)]
pub entries: Vec<PlayerEntry>,
}