1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-23 21:17:45 +00:00

Fix "Unknown" data in some InventoryTransaction packets (for Packet Analyzer)

This commit is contained in:
The Dax 2025-07-20 11:32:33 -04:00 committed by Joshua Goins
parent 408f002593
commit 05f3f7586a
3 changed files with 13 additions and 11 deletions

View file

@ -958,7 +958,7 @@ async fn client_loop(
timestamp: timestamp_secs(),
data: ServerZoneIpcData::InventoryTransaction {
sequence: connection.player_data.item_sequence,
operation_type: ItemOperationKind::UpdateCurrency,
operation_type: ItemOperationKind::Update,
src_actor_id: connection.player_data.actor_id,
src_storage_id: ContainerType::Currency,
src_container_index: 0,

View file

@ -37,19 +37,21 @@ const MAX_LARGE_STORAGE: usize = 50;
#[brw(repr = u8)]
#[repr(u8)]
pub enum ItemOperationKind {
/// The operation opcode/type when updating the currency storage.
UpdateCurrency = BASE_INVENTORY_ACTION,
/// The operation opcode/type when discarding an item from the inventory.
Discard = BASE_INVENTORY_ACTION + 1,
/// The operation opcode/type when an item is created in the inventory. Seen during currency shop transactions, and likely elsewhere.
Create = BASE_INVENTORY_ACTION,
/// The operation opcode/type when updating the inventory. Seen during all shop transactions when updating currency, and elsewhere.
Update = BASE_INVENTORY_ACTION + 1,
/// The operation opcode/type when discarding an item from the inventory. Seen when discarding an item from the inventory, and during gilshop sell transactions.
Discard = BASE_INVENTORY_ACTION + 2,
#[default]
/// The operation opcode/type when moving an item to an emtpy slot in the inventory.
Move = BASE_INVENTORY_ACTION + 2,
Move = BASE_INVENTORY_ACTION + 3,
/// The operation opcode/type when moving an item to a slot occupied by another in the inventory.
Exchange = BASE_INVENTORY_ACTION + 3,
Exchange = BASE_INVENTORY_ACTION + 4,
/// The operation opcode/type when splitting stacks of identical items.
SplitStack = BASE_INVENTORY_ACTION + 4,
SplitStack = BASE_INVENTORY_ACTION + 5,
/// The operation opcode/type when combining stacks of identical items.
CombineStack = BASE_INVENTORY_ACTION + 6,
CombineStack = BASE_INVENTORY_ACTION + 7,
}
impl TryFrom<u8> for ItemOperationKind {

View file

@ -103,8 +103,8 @@ pub const PVP_ARRAY_SIZE: usize = 7;
/// The maximum durability of an item.
pub const ITEM_CONDITION_MAX: u16 = 30000;
// This operation code change regularly, so update it when needed!
pub const BASE_INVENTORY_ACTION: u8 = 144;
// This operation code changes regularly, so update it when needed!
pub const BASE_INVENTORY_ACTION: u8 = 143;
/// The server's acknowledgement of a shop item being purchased.
pub const INVENTORY_ACTION_ACK_SHOP: u8 = 6;