mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-17 10:47:44 +00:00
Inform client about some unimplemented inventory containers
As seen in a retail capture, we should be sending these I guess.
This commit is contained in:
parent
c0daf7b06b
commit
fe4d0d2344
2 changed files with 36 additions and 0 deletions
|
@ -35,6 +35,7 @@ pub enum ContainerType {
|
||||||
ArmoryHead = 3201,
|
ArmoryHead = 3201,
|
||||||
ArmoryBody = 3202,
|
ArmoryBody = 3202,
|
||||||
ArmoryHand = 3203,
|
ArmoryHand = 3203,
|
||||||
|
ArmoryWaist = 3204,
|
||||||
ArmoryLeg = 3205,
|
ArmoryLeg = 3205,
|
||||||
ArmoryFoot = 3206,
|
ArmoryFoot = 3206,
|
||||||
ArmoryEarring = 3207,
|
ArmoryEarring = 3207,
|
||||||
|
|
|
@ -519,6 +519,7 @@ impl ZoneConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn send_inventory(&mut self, send_appearance_update: bool, first_update: bool) {
|
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())
|
for (sequence, (container_type, container)) in (&self.player_data.inventory.clone())
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
|
@ -618,6 +619,40 @@ impl ZoneConnection {
|
||||||
})
|
})
|
||||||
.await;
|
.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
|
// send them an appearance update
|
||||||
|
|
Loading…
Add table
Reference in a new issue