From d6c8bf2539488c986c8857263e379ee35b8b75a4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 5 Feb 2015 17:32:49 +0300 Subject: eathena: add packet SMSG_BUYINGSTORE_OWN_ITEMS 0x0813. --- src/net/eathena/buyingstorehandler.cpp | 19 +++++++++++++++++++ src/net/eathena/buyingstorehandler.h | 2 ++ src/net/eathena/packets.h | 2 +- src/net/eathena/protocol.h | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 135a866b4..29d6c86c5 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -44,6 +44,7 @@ BuyingStoreHandler::BuyingStoreHandler() : { SMSG_BUYINGSTORE_OPEN, SMSG_BUYINGSTORE_CREATE_FAILED, + SMSG_BUYINGSTORE_OWN_ITEMS, 0 }; handledMessages = _messages; @@ -62,6 +63,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg) processBuyingStoreCreateFailed(msg); break; + case SMSG_BUYINGSTORE_OWN_ITEMS: + processBuyingStoreOwnItems(msg); + break; + default: break; } @@ -94,6 +99,20 @@ void BuyingStoreHandler::processBuyingStoreCreateFailed(Net::MessageIn &msg) } } +void BuyingStoreHandler::processBuyingStoreOwnItems(Net::MessageIn &msg) +{ + const int count = (msg.readInt16("len") - 12) / 9; + msg.readInt32("account id"); + msg.readInt32("money limit"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("price"); + msg.readInt16("amount"); + msg.readUInt8("item type"); + msg.readInt16("item id"); + } +} + 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 790ebd751..a61074219 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -46,6 +46,8 @@ class BuyingStoreHandler final : public MessageHandler, static void processBuyingStoreOpen(Net::MessageIn &msg); static void processBuyingStoreCreateFailed(Net::MessageIn &msg); + + static void processBuyingStoreOwnItems(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 821484775..1a3d3de2d 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, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 22, 8, 0, + 3, 0, 8, -1, 0, -1, 0, 0, 0, 0, 0, 0, 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 b8c6531b8..41d43bc2a 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -169,6 +169,7 @@ #define SMSG_BUYINGSTORE_OPEN 0x0810 #define SMSG_BUYINGSTORE_CREATE_FAILED 0x0812 +#define SMSG_BUYINGSTORE_OWN_ITEMS 0x0813 // Receiving a request to trade #define SMSG_TRADE_REQUEST 0x01f4 -- cgit v1.2.3-70-g09d2