diff options
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/buyingstorehandler.cpp | 23 | ||||
-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, 27 insertions, 1 deletions
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, diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h index e13ed5731..906b68bf2 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -64,6 +64,8 @@ class BuyingStoreHandler final : public MessageHandler, static void processBuyingStoreHideBoard(Net::MessageIn &msg); static void processBuyingStoreItemsList(Net::MessageIn &msg); + + static void processBuyingStoreSellFailed(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 54e5b21f1..e5f085949 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, 0, 0, 0, 22, 8, 0, + 3, 0, 8, -1, 86, -1, 0, 0, -1, 0, 4, 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 4b2e2ae03..abf18a2f3 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -173,6 +173,7 @@ #define SMSG_BUYINGSTORE_SHOW_BOARD 0x0814 #define SMSG_BUYINGSTORE_HIDE_BOARD 0x0816 #define SMSG_BUYINGSTORE_ITEMS_LIST 0x0818 +#define SMSG_BUYINGSTORE_SELL_FAILED 0x081a // Receiving a request to trade #define SMSG_TRADE_REQUEST 0x01f4 |