From 290ae8ba45bb706f32da15978459022e633aa626 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Aug 2016 02:06:25 +0300 Subject: Impliment packet SMSG_VENDING_BUY_ACK. --- src/net/eathena/vendingrecv.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/vendingrecv.cpp') diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp index 443e02d8e..468143dfd 100644 --- a/src/net/eathena/vendingrecv.cpp +++ b/src/net/eathena/vendingrecv.cpp @@ -22,10 +22,13 @@ #include "actormanager.h" #include "itemcolormanager.h" +#include "notifymanager.h" #include "being/localplayer.h" #include "being/playerinfo.h" +#include "enums/resources/notifytypes.h" + #include "gui/windows/buydialog.h" #include "gui/widgets/createwidget.h" @@ -135,10 +138,34 @@ void VendingRecv::processItemsList(Net::MessageIn &msg) void VendingRecv::processBuyAck(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; msg.readInt16("inv index"); msg.readInt16("amount"); - msg.readUInt8("flag"); + const int flag = msg.readUInt8("flag"); + switch (flag) + { + case 0: + break; + case 1: + NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY); + break; + case 2: + NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT); + break; + case 4: + NotifyManager::notify(NotifyTypes::BUY_FAILED_TOO_MANY_ITEMS); + break; + case 5: + NotifyManager::notify(NotifyTypes::BUY_TRADE_FAILED); + break; + case 6: // +++ probably need show exact error messages? + case 7: + NotifyManager::notify(NotifyTypes::BUY_FAILED); + break; + default: + NotifyManager::notify(NotifyTypes::BUY_FAILED); + UNIMPLIMENTEDPACKETFIELD(flag); + break; + } } void VendingRecv::processOpen(Net::MessageIn &msg) -- cgit v1.2.3-60-g2f50