1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-17 10:47:44 +00:00

Fill out more fields in PrepareZoning IPC

This fixes the loading screen between zones (as it now displays
text.) How we do things isn't very accurate still.
This commit is contained in:
Joshua Goins 2025-07-14 21:35:32 -04:00
parent e4342d04b8
commit 166e8024e0
3 changed files with 53 additions and 23 deletions

View file

@ -384,27 +384,6 @@ async fn client_loop(
.await;
}
// fade in?
{
let ipc = ServerZoneIpcSegment {
op_code: ServerZoneIpcType::PrepareZoning,
timestamp: timestamp_secs(),
data: ServerZoneIpcData::PrepareZoning {
unk: [0, 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: SegmentData::Ipc { data: ipc },
})
.await;
}
// wipe any exit position so it isn't accidentally reused
connection.exit_position = None;
connection.exit_rotation = None;

View file

@ -247,7 +247,18 @@ pub enum ServerZoneIpcData {
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 {
log_message: u32,
target_zone: u16,
animation: u16,
param4: u8,
hide_character: u8,
fade_out: u8,
param_7: u8,
fade_out_time: u8,
unk1: u8,
unk2: u16,
},
/// Sent by the server
#[br(pre_assert(*magic == ServerZoneIpcType::ActorControl))]
ActorControl(ActorControl),
@ -787,7 +798,18 @@ mod tests {
),
(
ServerZoneIpcType::PrepareZoning,
ServerZoneIpcData::PrepareZoning { unk: [0; 4] },
ServerZoneIpcData::PrepareZoning {
log_message: 0,
target_zone: 0,
animation: 0,
param4: 0,
hide_character: 0,
fade_out: 0,
param_7: 0,
fade_out_time: 0,
unk1: 0,
unk2: 0,
},
),
(
ServerZoneIpcType::ActorControl,

View file

@ -368,6 +368,35 @@ impl ZoneConnection {
self.player_data.zone_id = new_zone_id;
// fade in?
{
let ipc = ServerZoneIpcSegment {
op_code: ServerZoneIpcType::PrepareZoning,
timestamp: timestamp_secs(),
data: ServerZoneIpcData::PrepareZoning {
log_message: 0,
target_zone: self.player_data.zone_id,
animation: 0,
param4: 0,
hide_character: 0,
fade_out: 1,
param_7: 1,
fade_out_time: 1,
unk1: 8,
unk2: 0,
},
..Default::default()
};
self.send_segment(PacketSegment {
source_actor: self.player_data.actor_id,
target_actor: self.player_data.actor_id,
segment_type: SegmentType::Ipc,
data: SegmentData::Ipc { data: ipc },
})
.await;
}
// Player Class Info
self.update_class_info().await;