diff options
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, |