diff options
Diffstat (limited to 'src')
-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 | ||||
-rw-r--r-- | src/resources/notifications.h | 25 | ||||
-rw-r--r-- | src/resources/notifytypes.h | 4 |
6 files changed, 58 insertions, 5 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 diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 60e2cefad..5288a96a0 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -437,18 +437,35 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Buying store create failed. No items in store."), NotifyFlags::EMPTY}, - {"buying store sell failed money limit", + {"buying store buy failed money limit", // TRANSLATORS: notification message N_("All items within the buy limit were purchased."), NotifyFlags::EMPTY}, - {"buying store sell failed empty", + {"buying store buy failed empty", // TRANSLATORS: notification message N_("All items were purchased."), NotifyFlags::EMPTY}, - {"buying store sell failed", + {"buying store buy failed", // TRANSLATORS: notification message N_("Buying item failed."), - NotifyFlags::EMPTY} + NotifyFlags::EMPTY}, + {"buying store sell failed deal", + // TRANSLATORS: notification message + N_("The deal has failed."), + NotifyFlags::EMPTY}, + {"buying store sell failed amount", + // TRANSLATORS: notification message + N_("The trade failed, because the entered amount of item is " + "higher, than the buyer is willing to buy."), + NotifyFlags::EMPTY}, + {"buying store sell failed balance", + // TRANSLATORS: notification message + N_("The trade failed, because the buyer is lacking required balance."), + NotifyFlags::EMPTY}, + {"buying store sell failed", + // TRANSLATORS: notification message + N_("Selling item failed."), + NotifyFlags::EMPTY}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index f8c2f737c..a0730f829 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -131,6 +131,10 @@ namespace NotifyTypes BUYING_STORE_SELL_FAILED_MONEY_LIMIT, BUYING_STORE_SELL_FAILED_EMPTY, BUYING_STORE_SELL_FAILED, + BUYING_STORE_SELLER_SELL_FAILED_DEAL, + BUYING_STORE_SELLER_SELL_FAILED_AMOUNT, + BUYING_STORE_SELLER_SELL_FAILED_BALANCE, + BUYING_STORE_SELLER_SELL_FAILED, TYPE_END }; |