diff --git a/src/world/connection.rs b/src/world/connection.rs index e8a857c..630fd80 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -479,9 +479,10 @@ impl ZoneConnection { } pub async fn send_inventory(&mut self, send_appearance_update: bool) { - let mut sequence = 0; - - for (container_type, container) in &self.player_data.inventory.clone() { + for (sequence, (container_type, container)) in (&self.player_data.inventory.clone()) + .into_iter() + .enumerate() + { // currencies if container_type == ContainerType::Currency { let mut send_currency = async |item: &Item| { @@ -489,7 +490,7 @@ impl ZoneConnection { op_code: ServerZoneIpcType::CurrencyCrystalInfo, timestamp: timestamp_secs(), data: ServerZoneIpcData::CurrencyCrystalInfo(CurrencyInfo { - sequence, + sequence: sequence as u32, container: container_type, quantity: item.quantity, catalog_id: item.id, @@ -519,7 +520,7 @@ impl ZoneConnection { op_code: ServerZoneIpcType::UpdateItem, timestamp: timestamp_secs(), data: ServerZoneIpcData::UpdateItem(ItemInfo { - sequence, + sequence: sequence as u32, container: container_type, slot: slot_index, quantity: item.quantity, @@ -553,7 +554,7 @@ impl ZoneConnection { data: ServerZoneIpcData::ContainerInfo(ContainerInfo { container: container_type, num_items: container.num_items(), - sequence, + sequence: sequence as u32, ..Default::default() }), ..Default::default() @@ -567,8 +568,6 @@ impl ZoneConnection { }) .await; } - - sequence += 1; } // send them an appearance update diff --git a/src/world/server.rs b/src/world/server.rs index ef28c1a..7a99fa0 100644 --- a/src/world/server.rs +++ b/src/world/server.rs @@ -309,7 +309,9 @@ pub async fn server_main_loop(mut recv: Receiver) -> Result<(), std::i // handle player-to-server actions if id == from_id { - if let ClientTriggerCommand::TeleportQuery { aetheryte_id } = &trigger.trigger { + if let ClientTriggerCommand::TeleportQuery { aetheryte_id } = + &trigger.trigger + { let msg = FromServer::ActorControlSelf(ActorControlSelf { category: ActorControlCategory::TeleportStart { insufficient_gil: 0,