diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-07 13:03:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-07 13:03:33 +0300 |
commit | a39151db799a49eac2ae0588f99a6cad23b914c3 (patch) | |
tree | c15466d50006890bc21fb2941ad217872c55f7fc /src | |
parent | f8bfed03f76e377bd036d502663f3b9d3268a4a5 (diff) | |
download | plus-a39151db799a49eac2ae0588f99a6cad23b914c3.tar.gz plus-a39151db799a49eac2ae0588f99a6cad23b914c3.tar.bz2 plus-a39151db799a49eac2ae0588f99a6cad23b914c3.tar.xz plus-a39151db799a49eac2ae0588f99a6cad23b914c3.zip |
eathena: add partial support for packet SMSG_VENDING_ITEMS_LIST 0x0800.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 | ||||
-rw-r--r-- | src/net/eathena/vendinghandler.cpp | 23 | ||||
-rw-r--r-- | src/net/eathena/vendinghandler.h | 2 |
4 files changed, 27 insertions, 1 deletions
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 8b9741ad1..63fa106d3 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -215,7 +215,7 @@ int16_t packet_lengths[] = //0 1 2 3 4 5 6 7 8 9 a b c d e f //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // #0x0800 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 20, + -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 20, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 26, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 94ffd600c..0ee9e2bf0 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -309,6 +309,7 @@ #define SMSG_VENDING_OPEN_REQ 0x012d #define SMSG_VENDING_SHOW_BOARD 0x0131 #define SMSG_VENDING_HIDE_BOARD 0x0132 +#define SMSG_VENDING_ITEMS_LIST 0x0800 #define SMSG_ELEMENTAL_UPDATE_STATUS 0x081e #define SMSG_ELEMENTAL_INFO 0x081d diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index 8a1dd2ba8..10ced1a07 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -37,6 +37,7 @@ VendingHandler::VendingHandler() : SMSG_VENDING_OPEN_REQ, SMSG_VENDING_SHOW_BOARD, SMSG_VENDING_HIDE_BOARD, + SMSG_VENDING_ITEMS_LIST, 0 }; handledMessages = _messages; @@ -59,6 +60,10 @@ void VendingHandler::handleMessage(Net::MessageIn &msg) processHideBoard(msg); break; + case SMSG_VENDING_ITEMS_LIST: + processItemsList(msg); + break; + default: break; } @@ -80,4 +85,22 @@ void VendingHandler::processHideBoard(Net::MessageIn &msg) msg.readInt32("owner id"); } +void VendingHandler::processItemsList(Net::MessageIn &msg) +{ + const int count = (msg.readInt16("len") - 12) / 22; + msg.readInt32("id"); + msg.readInt32("vender id"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("price"); + msg.readInt16("amount"); + msg.readInt16("inv index"); + msg.readUInt8("item type"); + msg.readInt16("item id"); + msg.readUInt8("identify"); + msg.readUInt8("attribute"); + msg.readUInt8("refine"); + } +} + } // namespace EAthena diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h index 33cca37fd..27c8ef937 100644 --- a/src/net/eathena/vendinghandler.h +++ b/src/net/eathena/vendinghandler.h @@ -43,6 +43,8 @@ class VendingHandler final : public MessageHandler, static void processShowBoard(Net::MessageIn &msg); static void processHideBoard(Net::MessageIn &msg); + + static void processItemsList(Net::MessageIn &msg); }; } // namespace EAthena |