From fe4d0d234434f9a9e9f7e7b85792683535f11828 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 13 Jul 2025 08:38:28 -0400 Subject: [PATCH] Inform client about some unimplemented inventory containers As seen in a retail capture, we should be sending these I guess. --- src/inventory/storage.rs | 1 + src/world/connection.rs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/inventory/storage.rs b/src/inventory/storage.rs index 5bed319..92c341d 100644 --- a/src/inventory/storage.rs +++ b/src/inventory/storage.rs @@ -35,6 +35,7 @@ pub enum ContainerType { ArmoryHead = 3201, ArmoryBody = 3202, ArmoryHand = 3203, + ArmoryWaist = 3204, ArmoryLeg = 3205, ArmoryFoot = 3206, ArmoryEarring = 3207, diff --git a/src/world/connection.rs b/src/world/connection.rs index 330e8cd..3621abf 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -519,6 +519,7 @@ impl ZoneConnection { } pub async fn send_inventory(&mut self, send_appearance_update: bool, first_update: bool) { + let mut last_sequence = 0; for (sequence, (container_type, container)) in (&self.player_data.inventory.clone()) .into_iter() .enumerate() @@ -618,6 +619,40 @@ impl ZoneConnection { }) .await; } + + last_sequence = sequence; + } + + let mut sequence = last_sequence + 1; + + // dummy container states that are not implemented + // inform the client of container state + for container_type in [ + ContainerType::Crystals, + ContainerType::Mail, + ContainerType::Unk2, + ContainerType::ArmoryWaist, + ] { + let ipc = ServerZoneIpcSegment { + op_code: ServerZoneIpcType::ContainerInfo, + timestamp: timestamp_secs(), + data: ServerZoneIpcData::ContainerInfo(ContainerInfo { + container: container_type, + num_items: 0, + sequence: sequence as u32, + ..Default::default() + }), + ..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; + sequence += 1; } // send them an appearance update