summaryrefslogtreecommitdiff
path: root/src
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
parent4ae0cd0b3838cc3354702af2ca6d669a91afdd8d (diff)
downloadplus-2aef4c43560203a41ee2866245732fbfa2639a6d.tar.gz
plus-2aef4c43560203a41ee2866245732fbfa2639a6d.tar.bz2
plus-2aef4c43560203a41ee2866245732fbfa2639a6d.tar.xz
plus-2aef4c43560203a41ee2866245732fbfa2639a6d.zip
eathena: add partial support for packet SMSG_SEARCHSTORE_SEARCH_ACK 0x0836.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h2
-rw-r--r--src/net/eathena/searchstorehandler.cpp26
-rw-r--r--src/net/eathena/searchstorehandler.h3
4 files changed, 32 insertions, 1 deletions
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 75fae8ae9..2f0a79cb9 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -217,7 +217,7 @@ int16_t packet_lengths[] =
// #0x0800
-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 20,
3, 0, 8, -1, 86, -1, 0, 0, -1, 0, 4, 10, 10, 22, 8, 0,
- 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0,
+ 0, 0, 0, 0, 6, 0, -1, 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,
// #0x0840
-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index a214674ed..cdff5a705 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -343,6 +343,8 @@
#define SMSG_CART_INFO 0x0121
#define SMSG_CART_REMOVE 0x012b
+#define SMSG_SEARCHSTORE_SEARCH_ACK 0x0836
+
/**********************************
* Packets from client to server *
**********************************/
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
diff --git a/src/net/eathena/searchstorehandler.h b/src/net/eathena/searchstorehandler.h
index 56e44dd8b..bd2cf80c7 100644
--- a/src/net/eathena/searchstorehandler.h
+++ b/src/net/eathena/searchstorehandler.h
@@ -41,6 +41,9 @@ class SearchStoreHandler final : public MessageHandler,
const int minPrice,
const int maxPrice,
const int itemId) const override final;
+
+ protected:
+ static void processSearchAck(Net::MessageIn &msg);
};
} // namespace EAthena