summaryrefslogtreecommitdiff
path: root/src/net/eathena/searchstorehandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-09 16:14:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-09 16:14:00 +0300
commit2aef4c43560203a41ee2866245732fbfa2639a6d (patch)
tree10a3d2f9b03f6772faa512a034bb38dd0a5c2661 /src/net/eathena/searchstorehandler.cpp
parent4ae0cd0b3838cc3354702af2ca6d669a91afdd8d (diff)
downloadmv-2aef4c43560203a41ee2866245732fbfa2639a6d.tar.gz
mv-2aef4c43560203a41ee2866245732fbfa2639a6d.tar.bz2
mv-2aef4c43560203a41ee2866245732fbfa2639a6d.tar.xz
mv-2aef4c43560203a41ee2866245732fbfa2639a6d.zip
eathena: add partial support for packet SMSG_SEARCHSTORE_SEARCH_ACK 0x0836.
Diffstat (limited to 'src/net/eathena/searchstorehandler.cpp')
-rw-r--r--src/net/eathena/searchstorehandler.cpp26
1 files changed, 26 insertions, 0 deletions
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