diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-25 02:06:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-25 02:06:25 +0300 |
commit | 290ae8ba45bb706f32da15978459022e633aa626 (patch) | |
tree | 50397063992bb417b7e9ca494975908910170f10 | |
parent | 52041a3f1af82140755ac2096375ded772d7ccf7 (diff) | |
download | ManaVerse-290ae8ba45bb706f32da15978459022e633aa626.tar.gz ManaVerse-290ae8ba45bb706f32da15978459022e633aa626.tar.bz2 ManaVerse-290ae8ba45bb706f32da15978459022e633aa626.tar.xz ManaVerse-290ae8ba45bb706f32da15978459022e633aa626.zip |
Impliment packet SMSG_VENDING_BUY_ACK.
-rw-r--r-- | src/enums/resources/notifytypes.h | 1 | ||||
-rw-r--r-- | src/gui/windows/buydialog.cpp | 1 | ||||
-rw-r--r-- | src/net/eathena/vendingrecv.cpp | 31 | ||||
-rw-r--r-- | src/resources/notifications.h | 4 |
4 files changed, 35 insertions, 2 deletions
diff --git a/src/enums/resources/notifytypes.h b/src/enums/resources/notifytypes.h index 60600ef0c..06dd6e69a 100644 --- a/src/enums/resources/notifytypes.h +++ b/src/enums/resources/notifytypes.h @@ -228,6 +228,7 @@ namespace NotifyTypes SKILL_MEMO_SAVED, SKILL_MEMO_ERROR_LEVEL, SKILL_MEMO_ERROR_SKILL, + BUY_TRADE_FAILED, TYPE_END }; diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 7c7d96a13..eb01e0562 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -54,6 +54,7 @@ #include "resources/iteminfo.h" +#include "utils/checkutils.h" #include "utils/delete2.h" #include <algorithm> 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) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 8cb06d1ab..58ae9e056 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -828,6 +828,10 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Error saving location. You do not have warp skill."), NotifyFlags::EMPTY}, + {"buy trade fail", + // TRANSLATORS: notification message + N_("Unable to buy while trading."), + NotifyFlags::EMPTY}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H |