diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-01-31 18:14:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-01-31 18:14:44 +0300 |
commit | cdd2dd27b61e36a376dc32947fd9e29f0a492d9b (patch) | |
tree | 88ec4ac6acbc090600c52bddddd978a15e0d0312 /src/net/eathena/cashshoprecv.cpp | |
parent | c0255f61476a509780d316801a6a3d54c2f362ec (diff) | |
download | ManaVerse-cdd2dd27b61e36a376dc32947fd9e29f0a492d9b.tar.gz ManaVerse-cdd2dd27b61e36a376dc32947fd9e29f0a492d9b.tar.bz2 ManaVerse-cdd2dd27b61e36a376dc32947fd9e29f0a492d9b.tar.xz ManaVerse-cdd2dd27b61e36a376dc32947fd9e29f0a492d9b.zip |
Allow buy multiply items at once from cash shops.
Diffstat (limited to 'src/net/eathena/cashshoprecv.cpp')
-rw-r--r-- | src/net/eathena/cashshoprecv.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp index 6c75a1052..d9912342f 100644 --- a/src/net/eathena/cashshoprecv.cpp +++ b/src/net/eathena/cashshoprecv.cpp @@ -20,8 +20,12 @@ #include "net/eathena/cashshoprecv.h" +#include "notifymanager.h" + #include "being/playerinfo.h" +#include "enums/resources/notifytypes.h" + #include "gui/windows/buydialog.h" #include "gui/widgets/createwidget.h" @@ -69,11 +73,37 @@ void CashShopRecv::processCashShopOpen(Net::MessageIn &msg) void CashShopRecv::processCashShopBuyAck(Net::MessageIn &msg) { - UNIMPLEMENTEDPACKET; msg.readInt32("cash points"); if (packetVersion >= 20070711) msg.readInt32("kafra points"); - msg.readInt16("error"); + const uint16_t res = msg.readInt16("error"); + switch (res) + { + case 0: + NotifyManager::notify(NotifyTypes::BUY_DONE); + break; + case 1: + NotifyManager::notify(NotifyTypes::BUY_FAILED_NPC_NOT_FOUND); + break; + case 2: + NotifyManager::notify(NotifyTypes::BUY_FAILED_SYSTEM_ERROR); + break; + case 3: + NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); + break; + case 4: + NotifyManager::notify(NotifyTypes::BUY_TRADE_FAILED); + break; + case 5: + NotifyManager::notify(NotifyTypes::BUY_FAILED_WRONG_ITEM); + break; + case 6: + NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); + break; + default: + UNIMPLEMENTEDPACKETFIELD(res); + break; + } } void CashShopRecv::processCashShopPoints(Net::MessageIn &msg) |