diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-05 12:36:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-05 12:36:17 +0300 |
commit | b70f77df7ef4bd06b35511e17aa74fc3493dfcd9 (patch) | |
tree | a24b1b6c882faa9e4b1a31da3ef48c7f94eb3a17 /src/net/eathena/buyingstorehandler.cpp | |
parent | 805299e4d653440c582f6c576bcd7de2e1b2c3d4 (diff) | |
download | mv-b70f77df7ef4bd06b35511e17aa74fc3493dfcd9.tar.gz mv-b70f77df7ef4bd06b35511e17aa74fc3493dfcd9.tar.bz2 mv-b70f77df7ef4bd06b35511e17aa74fc3493dfcd9.tar.xz mv-b70f77df7ef4bd06b35511e17aa74fc3493dfcd9.zip |
eathena: add packet SMSG_BUYINGSTORE_CREATE_FAILED 0x0812.
Diffstat (limited to 'src/net/eathena/buyingstorehandler.cpp')
-rw-r--r-- | src/net/eathena/buyingstorehandler.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 166512eca..135a866b4 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -20,6 +20,7 @@ #include "net/eathena/buyingstorehandler.h" +#include "notifymanager.h" #include "shopitem.h" #include "net/ea/eaprotocol.h" @@ -27,6 +28,8 @@ #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" +#include "resources/notifytypes.h" + #include "debug.h" extern Net::BuyingStoreHandler *buyingStoreHandler; @@ -40,6 +43,7 @@ BuyingStoreHandler::BuyingStoreHandler() : static const uint16_t _messages[] = { SMSG_BUYINGSTORE_OPEN, + SMSG_BUYINGSTORE_CREATE_FAILED, 0 }; handledMessages = _messages; @@ -54,6 +58,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg) processBuyingStoreOpen(msg); break; + case SMSG_BUYINGSTORE_CREATE_FAILED: + processBuyingStoreCreateFailed(msg); + break; + default: break; } @@ -65,6 +73,27 @@ void BuyingStoreHandler::processBuyingStoreOpen(Net::MessageIn &msg) msg.readUInt8("slots"); } +void BuyingStoreHandler::processBuyingStoreCreateFailed(Net::MessageIn &msg) +{ + const int16_t result = msg.readInt16("result"); + const int weight = msg.readInt32("weight"); + switch (result) + { + case 0: + default: + NotifyManager::notify(NotifyTypes::BUYING_STORE_CREATE_FAILED); + break; + case 1: + NotifyManager::notify( + NotifyTypes::BUYING_STORE_CREATE_FAILED_WEIGHT, + weight); + break; + case 8: + NotifyManager::notify(NotifyTypes::BUYING_STORE_CREATE_EMPTY); + break; + } +} + void BuyingStoreHandler::create(const std::string &name, const int maxMoney, const bool flag, |