From 037a653c92fca6e34f6f27c05efe70b8d4d95178 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 5 Feb 2015 21:37:22 +0300 Subject: eathena: add partial support for packet SMSG_BUYINGSTORE_ITEMS_LIST 0x0818 --- src/net/eathena/buyingstorehandler.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/net/eathena/buyingstorehandler.cpp') diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 44a8a7d4b..42bd41c7b 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -49,6 +49,7 @@ BuyingStoreHandler::BuyingStoreHandler() : SMSG_BUYINGSTORE_OWN_ITEMS, SMSG_BUYINGSTORE_SHOW_BOARD, SMSG_BUYINGSTORE_HIDE_BOARD, + SMSG_BUYINGSTORE_ITEMS_LIST, 0 }; handledMessages = _messages; @@ -79,6 +80,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg) processBuyingStoreHideBoard(msg); break; + case SMSG_BUYINGSTORE_ITEMS_LIST: + processBuyingStoreItemsList(msg); + break; + default: break; } @@ -136,6 +141,21 @@ void BuyingStoreHandler::processBuyingStoreHideBoard(Net::MessageIn &msg) msg.readInt32("account id"); } +void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg) +{ + const int count = (msg.readInt16("len") - 16) / 9; + msg.readInt32("account id"); + msg.readInt32("store id"); + msg.readInt32("money limit"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("price"); + msg.readInt16("amount"); + msg.readUInt8("item type"); + msg.readInt16("item id"); + } +} + void BuyingStoreHandler::create(const std::string &name, const int maxMoney, const bool flag, -- cgit v1.2.3-60-g2f50