summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/protocol.h2
-rw-r--r--src/net/eathena/searchstorehandler.cpp18
-rw-r--r--src/net/eathena/searchstorehandler.h5
3 files changed, 25 insertions, 0 deletions
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 640db8a78..a214674ed 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -561,4 +561,6 @@
#define CMSG_BUYINGSTORE_OPEN 0x0360
#define CMSG_BUYINGSTORE_SELL 0x0811
+#define CMSG_SEARCHSTORE_SEARCH 0x0819
+
#endif // NET_EATHENA_PROTOCOL_H
diff --git a/src/net/eathena/searchstorehandler.cpp b/src/net/eathena/searchstorehandler.cpp
index 38baadd6d..4ddad3148 100644
--- a/src/net/eathena/searchstorehandler.cpp
+++ b/src/net/eathena/searchstorehandler.cpp
@@ -20,6 +20,9 @@
#include "net/eathena/searchstorehandler.h"
+#include "net/eathena/messageout.h"
+#include "net/eathena/protocol.h"
+
#include "debug.h"
extern Net::SearchStoreHandler *searchStoreHandler;
@@ -47,4 +50,19 @@ void SearchStoreHandler::handleMessage(Net::MessageIn &msg)
}
}
+void SearchStoreHandler::search(const StoreSearchType::Type type,
+ const int minPrice,
+ const int maxPrice,
+ const int itemId) const
+{
+ createOutPacket(CMSG_SEARCHSTORE_SEARCH);
+ outMsg.writeInt16(23, "len");
+ outMsg.writeInt8(static_cast<uint8_t>(type), "search type");
+ outMsg.writeInt32(maxPrice, "max price");
+ outMsg.writeInt32(minPrice, "min price");
+ outMsg.writeInt32(1, "items count");
+ outMsg.writeInt32(0, "cards count");
+ outMsg.writeInt16(itemId, "item id");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/searchstorehandler.h b/src/net/eathena/searchstorehandler.h
index f9c486faf..56e44dd8b 100644
--- a/src/net/eathena/searchstorehandler.h
+++ b/src/net/eathena/searchstorehandler.h
@@ -36,6 +36,11 @@ class SearchStoreHandler final : public MessageHandler,
A_DELETE_COPY(SearchStoreHandler)
void handleMessage(Net::MessageIn &msg) override final;
+
+ void search(const StoreSearchType::Type type,
+ const int minPrice,
+ const int maxPrice,
+ const int itemId) const override final;
};
} // namespace EAthena