summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-25 02:06:25 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-25 02:06:25 +0300
commit290ae8ba45bb706f32da15978459022e633aa626 (patch)
tree50397063992bb417b7e9ca494975908910170f10 /src/net
parent52041a3f1af82140755ac2096375ded772d7ccf7 (diff)
downloadmanaverse-290ae8ba45bb706f32da15978459022e633aa626.tar.gz
manaverse-290ae8ba45bb706f32da15978459022e633aa626.tar.bz2
manaverse-290ae8ba45bb706f32da15978459022e633aa626.tar.xz
manaverse-290ae8ba45bb706f32da15978459022e633aa626.zip
Impliment packet SMSG_VENDING_BUY_ACK.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/vendingrecv.cpp31
1 files changed, 29 insertions, 2 deletions
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)