diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-06 22:57:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-06 22:57:38 +0300 |
commit | 4cb9439d01c50141ce14e24180b50e20d17895d6 (patch) | |
tree | 03aea812492e94cb12dc50b1dd2f564905e1bf6b /src/net | |
parent | 77f95ae5238aad4dbbdc88772929ca78fbfe0577 (diff) | |
download | manaplus-4cb9439d01c50141ce14e24180b50e20d17895d6.tar.gz manaplus-4cb9439d01c50141ce14e24180b50e20d17895d6.tar.bz2 manaplus-4cb9439d01c50141ce14e24180b50e20d17895d6.tar.xz manaplus-4cb9439d01c50141ce14e24180b50e20d17895d6.zip |
eathena: add packet SMSG_BUYINGSTORE_SELLER_SELL_FAILED 0x0824.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/buyingstorehandler.cpp | 29 | ||||
-rw-r--r-- | src/net/eathena/buyingstorehandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
4 files changed, 33 insertions, 1 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 68fe18f2a..e7730c1ca 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -53,6 +53,7 @@ BuyingStoreHandler::BuyingStoreHandler() : SMSG_BUYINGSTORE_SELL_FAILED, SMSG_BUYINGSTORE_REPORT, SMSG_BUYINGSTORE_DELETE_ITEM, + SMSG_BUYINGSTORE_SELLER_SELL_FAILED, 0 }; handledMessages = _messages; @@ -99,6 +100,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg) processBuyingStoreDeleteItem(msg); break; + case SMSG_BUYINGSTORE_SELLER_SELL_FAILED: + processBuyingStoreSellerSellFailed(msg); + break; + default: break; } @@ -189,6 +194,30 @@ void BuyingStoreHandler::processBuyingStoreSellFailed(Net::MessageIn &msg) } } +void BuyingStoreHandler::processBuyingStoreSellerSellFailed(Net::MessageIn &msg) +{ + const int16_t result = msg.readInt16("result"); + msg.readInt16("item id"); + switch (result) + { + case 5: + NotifyManager::notify( + NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED_DEAL); + break; + case 6: + NotifyManager::notify( + NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED_AMOUNT); + break; + case 7: + NotifyManager::notify( + NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED_BALANCE); + break; + default: + NotifyManager::notify(NotifyTypes::BUYING_STORE_SELLER_SELL_FAILED); + break; + } +} + void BuyingStoreHandler::processBuyingStoreReport(Net::MessageIn &msg) { msg.readInt16("item id"); diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h index f66b097e8..f48373f03 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -70,6 +70,8 @@ class BuyingStoreHandler final : public MessageHandler, static void processBuyingStoreReport(Net::MessageIn &msg); static void processBuyingStoreDeleteItem(Net::MessageIn &msg); + + static void processBuyingStoreSellerSellFailed(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index ab33a3241..75fae8ae9 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, + 0, 0, 0, 0, 6, 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 -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 6a5860d0e..640db8a78 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -176,6 +176,7 @@ #define SMSG_BUYINGSTORE_SELL_FAILED 0x081a #define SMSG_BUYINGSTORE_REPORT 0x081b #define SMSG_BUYINGSTORE_DELETE_ITEM 0x081c +#define SMSG_BUYINGSTORE_SELLER_SELL_FAILED 0x0824 // Receiving a request to trade #define SMSG_TRADE_REQUEST 0x01f4 |