From 23a6cfe6fd8af082d2bb296f3a5efae9d1f834c9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 Feb 2015 21:55:38 +0300 Subject: eathena: add partial support for packet SMSG_BUYINGSTORE_REPORT 0x081b. --- src/net/eathena/buyingstorehandler.cpp | 12 ++++++++++++ src/net/eathena/buyingstorehandler.h | 2 ++ src/net/eathena/packets.h | 2 +- src/net/eathena/protocol.h | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 4ce4378bc..2356f6546 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -51,6 +51,7 @@ BuyingStoreHandler::BuyingStoreHandler() : SMSG_BUYINGSTORE_HIDE_BOARD, SMSG_BUYINGSTORE_ITEMS_LIST, SMSG_BUYINGSTORE_SELL_FAILED, + SMSG_BUYINGSTORE_REPORT, 0 }; handledMessages = _messages; @@ -89,6 +90,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg) processBuyingStoreSellFailed(msg); break; + case SMSG_BUYINGSTORE_REPORT: + processBuyingStoreReport(msg); + break; + default: break; } @@ -179,6 +184,13 @@ void BuyingStoreHandler::processBuyingStoreSellFailed(Net::MessageIn &msg) } } +void BuyingStoreHandler::processBuyingStoreReport(Net::MessageIn &msg) +{ + msg.readInt16("item id"); + msg.readInt16("amount"); + msg.readInt32("money limit"); +} + void BuyingStoreHandler::create(const std::string &name, const int maxMoney, const bool flag, diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h index 906b68bf2..7dc516736 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -66,6 +66,8 @@ class BuyingStoreHandler final : public MessageHandler, static void processBuyingStoreItemsList(Net::MessageIn &msg); static void processBuyingStoreSellFailed(Net::MessageIn &msg); + + static void processBuyingStoreReport(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index e5f085949..b4b80d279 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -216,7 +216,7 @@ int16_t packet_lengths[] = //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // #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, 0, 0, 22, 8, 0, + 3, 0, 8, -1, 86, -1, 0, 0, -1, 0, 4, 10, 0, 22, 8, 0, 0, 0, 0, 0, 0, 0, 0, 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 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index abf18a2f3..399b034cb 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -174,6 +174,7 @@ #define SMSG_BUYINGSTORE_HIDE_BOARD 0x0816 #define SMSG_BUYINGSTORE_ITEMS_LIST 0x0818 #define SMSG_BUYINGSTORE_SELL_FAILED 0x081a +#define SMSG_BUYINGSTORE_REPORT 0x081b // Receiving a request to trade #define SMSG_TRADE_REQUEST 0x01f4 -- cgit v1.2.3-60-g2f50