diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-02 22:14:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-02 22:14:54 +0300 |
commit | 3f8ef45a5f6918d2e0e9e25533e77133f0192464 (patch) | |
tree | 1eef39e2641ffdbdd0673e44b42c696906e38503 | |
parent | 8673aefdfd509e7d8e1c3585fee996a90d543068 (diff) | |
download | manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.tar.gz manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.tar.bz2 manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.tar.xz manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.zip |
Sort more packets. Add version checks inside packets.
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 8 | ||||
-rw-r--r-- | src/net/eathena/packetsin.inc | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 8add24d77..8a809c825 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -852,8 +852,12 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg) const int index = msg.readInt16("index") - INVENTORY_OFFSET; int amount = msg.readInt32("count"); const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("item type")); + ItemTypeT itemType = ItemType::Unknown; + if (msg.getVersion() >= 5) + { + itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); + } const uint8_t identified = msg.readUInt8("identified"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 55cdf49e5..59d771b8a 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -32,6 +32,7 @@ packet(SMSG_PLAYER_STORAGE_ADD, 0x00f4, 21, &InventoryRecv::processP packet(SMSG_PLAYER_STATUS_CHANGE, 0x0119, 13, &BeingRecv::processPlayerStatusChange, 1); packet(SMSG_SKILL_DAMAGE, 0x0114, 31, &BeingRecv::processSkillDamage, 1); packet(SMSG_SKILL_ENTRY, 0x011f, 16, &BeingRecv::processSkillEntry, 1); +packet(SMSG_PLAYER_CART_ADD, 0x0124, 21, &InventoryRecv::processPlayerCartAdd, 1); packet(SMSG_VENDING_ITEMS_LIST, 0x0133, -1, &VendingRecv::processItemsList, 1); packet(SMSG_VENDING_OPEN, 0x0136, -1, &VendingRecv::processOpen, 1); packet(SMSG_SKILL_CASTING, 0x013e, 24, &BeingRecv::processSkillCasting, 1); @@ -200,7 +201,6 @@ packet(SMSG_PLAYER_ARROW_EQUIP, 0x013c, 4, &Ea::InventoryRecv::proc packet(SMSG_PLAYER_ARROW_MESSAGE, 0x013b, 4, &Ea::PlayerRecv::processPlayerArrowMessage, 0); packet(SMSG_PLAYER_ATTACK_RANGE, 0x013a, 4, &Ea::InventoryRecv::processPlayerAttackRange, 0); packet(SMSG_PLAYER_CART_ADD_ERROR, 0x012c, 3, &InventoryRecv::processCartAddError, 0); -packet(SMSG_PLAYER_CART_ADD_OUTDATED, 0x0124, 21, nullptr, 0); packet(SMSG_PLAYER_CART_REMOVE, 0x0125, 8, &InventoryRecv::processPlayerCartRemove, 0); packet(SMSG_PLAYER_CHAT, 0x008e, -1, &ChatRecv::processChat, 0); packet(SMSG_PLAYER_GUILD_PARTY_INFO, 0x0195, 102, &BeingRecv::processPlayerGuilPartyInfo, 0); |