diff --git a/resources/opcodes.json b/resources/opcodes.json index 9cac43d..e60b5fb 100644 --- a/resources/opcodes.json +++ b/resources/opcodes.json @@ -301,7 +301,7 @@ "size": 32 }, { - "name": "GilShopRelatedUnk", + "name": "UpdateInventorySlot", "opcode": 435, "size": 64 } diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index 75d4b5c..0b94b83 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -917,12 +917,12 @@ async fn client_loop( //connection.player_data.inventory.add_in_next_free_slot(Item::new(*item_quantity, item_info.id)); connection.player_data.inventory.add_in_slot(Item::new(*item_quantity, item_info.id), &ContainerType::Inventory0, 0); - connection.send_gilshop_unk(0x07D0, 0, connection.player_data.inventory.currency.gil.quantity, 1).await; + connection.send_gilshop_item_update(0x07D0, 0, connection.player_data.inventory.currency.gil.quantity, 1).await; connection.send_inventory_ack(u32::MAX, INVENTORY_ACTION_ACK_SHOP as u16).await; // TODO: This is hardcoded to the first item slot in the inventory, fix this - connection.send_gilshop_unk(0, 0, *item_quantity, item_info.id).await; + connection.send_gilshop_item_update(0, 0, *item_quantity, item_info.id).await; connection.send_gilshop_ack(*event_id, item_info.id, *item_quantity, item_info.price_mid).await; let target_id = connection.player_data.target_actorid; diff --git a/src/ipc/zone/mod.rs b/src/ipc/zone/mod.rs index e6d6566..b7cdc36 100644 --- a/src/ipc/zone/mod.rs +++ b/src/ipc/zone/mod.rs @@ -497,8 +497,8 @@ pub enum ServerZoneIpcData { total_sale_cost: u32, }, #[brw(little)] - #[br(pre_assert(*magic == ServerZoneIpcType::GilShopRelatedUnk))] - GilShopRelatedUnk { + #[br(pre_assert(*magic == ServerZoneIpcType::UpdateInventorySlot))] + UpdateInventorySlot { /// Starts from zero and increases by one for each of these packets during this gameplay session sequence: u32, #[brw(pad_before = 4)] @@ -1013,8 +1013,8 @@ mod tests { }, ), ( - ServerZoneIpcType::GilShopRelatedUnk, - ServerZoneIpcData::GilShopRelatedUnk { + ServerZoneIpcType::UpdateInventorySlot, + ServerZoneIpcData::UpdateInventorySlot { sequence: 0, unk1_and_dst_storage_id: 0, unk2_and_dst_slot: 0, diff --git a/src/world/connection.rs b/src/world/connection.rs index fc4f87c..9da51d7 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -1027,7 +1027,7 @@ impl ZoneConnection { .await; } - pub async fn send_gilshop_unk( + pub async fn send_gilshop_item_update( &mut self, unk1_and_dst_storage_id: u16, unk2_and_dst_slot: u16, @@ -1035,9 +1035,9 @@ impl ZoneConnection { unk3_and_item_id: u32, ) { let ipc = ServerZoneIpcSegment { - op_code: ServerZoneIpcType::GilShopRelatedUnk, + op_code: ServerZoneIpcType::UpdateInventorySlot, timestamp: timestamp_secs(), - data: ServerZoneIpcData::GilShopRelatedUnk { + data: ServerZoneIpcData::UpdateInventorySlot { sequence: self.player_data.shop_sequence, unk1_and_dst_storage_id, unk2_and_dst_slot,