diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-26 20:06:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-26 20:06:09 +0300 |
commit | 7a94bb34d78f88c93e280da04dd8542b26686ed1 (patch) | |
tree | 5b149edf9799e8a482a4bdc26bc0f83a8df7ca7a /src/net/eathena/mail2recv.cpp | |
parent | 86735e142e86391e46b0eafbcb7ef01e25fc969a (diff) | |
download | manaverse-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.gz manaverse-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.bz2 manaverse-7a94bb34d78f88c93e280da04dd8542b26686ed1.tar.xz manaverse-7a94bb34d78f88c93e280da04dd8542b26686ed1.zip |
Add support for getting attached money from mail message.
Diffstat (limited to 'src/net/eathena/mail2recv.cpp')
-rw-r--r-- | src/net/eathena/mail2recv.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index 392e679d6..0ed6f44f0 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -459,10 +459,31 @@ void Mail2Recv::processMailDelete(Net::MessageIn &msg) void Mail2Recv::processRequestMoney(Net::MessageIn &msg) { - UNIMPLEMENTEDPACKET; - msg.readInt64("mail id"); + const int64_t mailId = msg.readInt64("mail id"); msg.readUInt8("open type"); - msg.readUInt8("result"); + const int res = msg.readUInt8("result"); + switch (res) + { + case 0: + NotifyManager::notify( + NotifyTypes::MAIL_GET_MONEY_OK); + if (mailViewWindow) + mailViewWindow->removeMoney(mailId); + break; + case 1: + NotifyManager::notify( + NotifyTypes::MAIL_GET_MONEY_ERROR); + break; + case 2: + NotifyManager::notify( + NotifyTypes::MAIL_GET_MONEY_LIMIT_ERROR); + break; + default: + UNIMPLEMENTEDPACKETFIELD(res); + NotifyManager::notify( + NotifyTypes::MAIL_GET_MONEY_ERROR); + break; + } } void Mail2Recv::processRequestItems(Net::MessageIn &msg) |