From 97a8156a1252806f8789fb6d4ae333b0e4cf88f6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 Feb 2015 19:59:04 +0300 Subject: eathena: add packet SMSG_BUYINGSTORE_SELL_FAILED 0x081a. --- src/net/eathena/buyingstorehandler.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/net/eathena/buyingstorehandler.cpp') diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 3e3451db2..4ce4378bc 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -50,6 +50,7 @@ BuyingStoreHandler::BuyingStoreHandler() : SMSG_BUYINGSTORE_SHOW_BOARD, SMSG_BUYINGSTORE_HIDE_BOARD, SMSG_BUYINGSTORE_ITEMS_LIST, + SMSG_BUYINGSTORE_SELL_FAILED, 0 }; handledMessages = _messages; @@ -84,6 +85,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg) processBuyingStoreItemsList(msg); break; + case SMSG_BUYINGSTORE_SELL_FAILED: + processBuyingStoreSellFailed(msg); + break; + default: break; } @@ -156,6 +161,24 @@ void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg) } } +void BuyingStoreHandler::processBuyingStoreSellFailed(Net::MessageIn &msg) +{ + const int16_t result = msg.readInt16("result"); + switch (result) + { + case 3: + NotifyManager::notify( + NotifyTypes::BUYING_STORE_SELL_FAILED_MONEY_LIMIT); + break; + case 4: + NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED_EMPTY); + break; + default: + NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED); + break; + } +} + void BuyingStoreHandler::create(const std::string &name, const int maxMoney, const bool flag, -- cgit v1.2.3-70-g09d2