From 89db2ce920446dda8ce8fb7977bf035fae863264 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 29 Mar 2025 16:40:33 -0400 Subject: [PATCH] Fix crash when entering certain zones, remove stuff doesn't work There's some fadein/fadeout nonsense that isn't really doing anything right now, and can be killed. --- resources/opcodes.json | 5 +++++ src/bin/kawari-world.rs | 46 +++-------------------------------------- src/world/ipc/mod.rs | 4 ++++ 3 files changed, 12 insertions(+), 43 deletions(-) diff --git a/resources/opcodes.json b/resources/opcodes.json index c8a09e6..b6183b7 100644 --- a/resources/opcodes.json +++ b/resources/opcodes.json @@ -256,6 +256,11 @@ "name": "EventRelatedUnk", "opcode": 861, "size": 16 + }, + { + "name": "Unk19", + "opcode": 379, + "size": 16 } ], "ServerLobbyIpcType": [ diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index f7360ff..ab6a54f 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -719,7 +719,6 @@ async fn main() { .unwrap() .find_exit_box(*exit_box_id) .unwrap(); - tracing::info!("exit box: {:#?}", exit_box); // find the pop range on the other side let new_zone = Zone::load(exit_box.territory_type); @@ -736,48 +735,6 @@ async fn main() { new_territory = exit_box.territory_type; } - // fade out? - { - let ipc = ServerZoneIpcSegment { - op_code: ServerZoneIpcType::PrepareZoning, - timestamp: timestamp_secs(), - data: ServerZoneIpcData::PrepareZoning { - unk: [0x01000000, 0, 0, 0], - }, - ..Default::default() - }; - - connection - .send_segment(PacketSegment { - source_actor: connection.player_data.actor_id, - target_actor: connection.player_data.actor_id, - segment_type: SegmentType::Ipc { data: ipc }, - }) - .await; - } - - // fade out? x2 - { - let ipc = ServerZoneIpcSegment { - op_code: ServerZoneIpcType::PrepareZoning, - timestamp: timestamp_secs(), - data: ServerZoneIpcData::PrepareZoning { - unk: [0, 0x00000085, 0x00030000, 0x000008ff], // last thing is probably a float? - }, - ..Default::default() - }; - - connection - .send_segment(PacketSegment { - source_actor: connection.player_data.actor_id, - target_actor: connection.player_data.actor_id, - segment_type: SegmentType::Ipc { data: ipc }, - }) - .await; - } - - tracing::info!("sending them to {:#?}", new_territory); - connection.change_zone(new_territory).await; } ClientZoneIpcData::ActionRequest(request) => { @@ -885,6 +842,9 @@ async fn main() { event.scene_finished(&mut lua_player, *unk2); } } + ClientZoneIpcData::Unk19 { .. } => { + tracing::info!("Recieved Unk19!"); + } } } SegmentType::KeepAlive { id, timestamp } => { diff --git a/src/world/ipc/mod.rs b/src/world/ipc/mod.rs index 6fcb451..9aa7a62 100644 --- a/src/world/ipc/mod.rs +++ b/src/world/ipc/mod.rs @@ -362,6 +362,10 @@ pub enum ClientZoneIpcData { unk3: u32, unk4: u32, }, + #[br(pre_assert(*magic == ClientZoneIpcType::Unk19))] + Unk19 { + unk: [u8; 16], // TODO: unknown + }, } #[cfg(test)]