From 2aef4c43560203a41ee2866245732fbfa2639a6d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Feb 2015 16:14:00 +0300 Subject: eathena: add partial support for packet SMSG_SEARCHSTORE_SEARCH_ACK 0x0836. --- src/net/eathena/searchstorehandler.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/net/eathena/searchstorehandler.cpp') diff --git a/src/net/eathena/searchstorehandler.cpp b/src/net/eathena/searchstorehandler.cpp index 4ddad3148..22f892a8a 100644 --- a/src/net/eathena/searchstorehandler.cpp +++ b/src/net/eathena/searchstorehandler.cpp @@ -35,6 +35,7 @@ SearchStoreHandler::SearchStoreHandler() : { static const uint16_t _messages[] = { + SMSG_SEARCHSTORE_SEARCH_ACK, 0 }; handledMessages = _messages; @@ -45,6 +46,10 @@ void SearchStoreHandler::handleMessage(Net::MessageIn &msg) { switch (msg.getId()) { + case SMSG_SEARCHSTORE_SEARCH_ACK: + processSearchAck(msg); + break; + default: break; } @@ -65,4 +70,25 @@ void SearchStoreHandler::search(const StoreSearchType::Type type, outMsg.writeInt16(itemId, "item id"); } +void SearchStoreHandler::processSearchAck(Net::MessageIn &msg) +{ + const int count = (msg.readInt16("len") - 7) / 106; + msg.readUInt8("is first page"); + msg.readUInt8("is next page"); + msg.readUInt8("remain uses"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("store id"); + msg.readInt32("aoount id"); + msg.readString(80, "store name"); + msg.readInt16("item id"); + msg.readUInt8("item type"); + msg.readInt32("price"); + msg.readInt16("amount"); + msg.readUInt8("refine"); + for (int f = 0; f < 4; f++) + msg.readInt16("card"); + } +} + } // namespace EAthena -- cgit v1.2.3-70-g09d2