diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-16 18:35:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 19:43:03 +0300 |
commit | 3242aa80fbee19eb421ace68d1c3c69e4fc777e6 (patch) | |
tree | 50cc1b2e47953c20059183889e667f673ba7e4c2 /src/net | |
parent | d207e52ab770681f8bd584c06dd9aa03096b71f5 (diff) | |
download | mv-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.tar.gz mv-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.tar.bz2 mv-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.tar.xz mv-3242aa80fbee19eb421ace68d1c3c69e4fc777e6.zip |
Add packet SMSG_ITEM_VISIBLE2 0x0b18.
Change net version to 10.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/itemhandler.cpp | 46 | ||||
-rw-r--r-- | src/net/eathena/itemhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/network.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 | ||||
-rw-r--r-- | src/net/tmwa/itemhandler.cpp | 8 |
6 files changed, 55 insertions, 6 deletions
diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp index 98ab79f78..004b97104 100644 --- a/src/net/eathena/itemhandler.cpp +++ b/src/net/eathena/itemhandler.cpp @@ -39,6 +39,7 @@ ItemHandler::ItemHandler() : static const uint16_t _messages[] = { SMSG_ITEM_VISIBLE, + SMSG_ITEM_VISIBLE2, SMSG_ITEM_DROPPED, SMSG_ITEM_REMOVE, SMSG_GRAFFITI_VISIBLE, @@ -72,6 +73,10 @@ void ItemHandler::handleMessage(Net::MessageIn &msg) processItemMvpDropped(msg); break; + case SMSG_ITEM_VISIBLE2: + processItemVisible2(msg); + break; + default: break; } @@ -97,9 +102,11 @@ void ItemHandler::processItemDropped(Net::MessageIn &msg) x, y, itemType, amount, + 0, ItemColor_one, identified, - subX, subY); + subX, subY, + nullptr); } } @@ -147,9 +154,44 @@ void ItemHandler::processItemVisible(Net::MessageIn &msg) x, y, 0, amount, + 0, + ItemColor_one, + identified, + subX, subY, + nullptr); + } +} + +void ItemHandler::processItemVisible2(Net::MessageIn &msg) +{ + const BeingId id = msg.readBeingId("item object id"); + const int itemId = msg.readInt16("item id"); + const int itemType = msg.readUInt8("type"); + const Identified identified = fromInt( + msg.readUInt8("identify"), Identified); + msg.readUInt8("attribute"); + const uint8_t refine = msg.readUInt8("refine"); + int cards[4]; + for (int f = 0; f < 4; f++) + cards[f] = msg.readInt16("card"); + const int x = msg.readInt16("x"); + const int y = msg.readInt16("y"); + const int amount = msg.readInt16("amount"); + const int subX = static_cast<int>(msg.readInt8("sub x")); + const int subY = static_cast<int>(msg.readInt8("sub y")); + + if (actorManager) + { + actorManager->createItem(id, + itemId, + x, y, + itemType, + amount, + refine, ItemColor_one, identified, - subX, subY); + subX, subY, + &cards[0]); } } diff --git a/src/net/eathena/itemhandler.h b/src/net/eathena/itemhandler.h index 5e8753126..f7029e1d0 100644 --- a/src/net/eathena/itemhandler.h +++ b/src/net/eathena/itemhandler.h @@ -47,6 +47,8 @@ class ItemHandler final : public MessageHandler, public Ea::ItemHandler static void processItemMvpDropped(Net::MessageIn &msg); static void processItemVisible(Net::MessageIn &msg); + + static void processItemVisible2(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/network.h b/src/net/eathena/network.h index 0d25bbf38..12f83c87d 100644 --- a/src/net/eathena/network.h +++ b/src/net/eathena/network.h @@ -29,7 +29,7 @@ * Protocol version, reported to the eAthena char and mapserver who can adjust * the protocol accordingly. */ -#define CLIENT_PROTOCOL_VERSION 9 +#define CLIENT_PROTOCOL_VERSION 10 namespace EAthena { diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index f88571130..722feca7d 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -282,7 +282,7 @@ int16_t packet_lengths[] = //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // #0x0B00 16, -1, 10, -1, -1, -1, -1, 0, 27, 0, -1, -1, 0, 0, 0, 0, - -1, 0, 0, 0, 0, 0, -1, 19, 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, -1, 19, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0B40 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index d3f0b3cb2..562ae4d06 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -140,6 +140,7 @@ packet(SMSG_SKILL_ARROW_CREATE_LIST, 0x01ad); packet(SMSG_SKILL_DEVOTION_EFFECT, 0x01cf); packet(SMSG_ITEM_USE_RESPONSE, 0x00a8); packet(SMSG_ITEM_VISIBLE, 0x009d); /**< An item is on the floor */ +packet(SMSG_ITEM_VISIBLE2, 0x0b18); packet(SMSG_GRAFFITI_VISIBLE, 0x01c9); packet(SMSG_ITEM_DROPPED, 0x084b); /**< An item is dropped */ packet(SMSG_ITEM_MVP_DROPPED, 0x07fd); diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp index 336fb619c..b99ca12dc 100644 --- a/src/net/tmwa/itemhandler.cpp +++ b/src/net/tmwa/itemhandler.cpp @@ -86,9 +86,11 @@ void ItemHandler::processItemDropped(Net::MessageIn &msg) x, y, 0, amount, + 0, identify, Identified_false, - subX, subY); + subX, subY, + nullptr); } } @@ -111,9 +113,11 @@ void ItemHandler::processItemVisible(Net::MessageIn &msg) x, y, 0, amount, + 0, ItemColor_one, identified, - subX, subY); + subX, subY, + nullptr); } } |