diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-12 16:45:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-12 16:45:40 +0300 |
commit | 3b77e87f120b096510f5c6af721563683057b101 (patch) | |
tree | f3e9d974bb0340baa0173cd6230e5c2d28230a56 /src/net | |
parent | b8176c75b6501146ebf610509e2d3218bf764e46 (diff) | |
download | plus-3b77e87f120b096510f5c6af721563683057b101.tar.gz plus-3b77e87f120b096510f5c6af721563683057b101.tar.bz2 plus-3b77e87f120b096510f5c6af721563683057b101.tar.xz plus-3b77e87f120b096510f5c6af721563683057b101.zip |
eathena: add partial support for packet SMSG_MAIL_READ_MAIL 0x0242.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/mailhandler.cpp | 30 | ||||
-rw-r--r-- | src/net/eathena/mailhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
4 files changed, 34 insertions, 1 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index 95c729c9b..e1da3ca6b 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -41,6 +41,7 @@ MailHandler::MailHandler() : { SMSG_MAIL_OPEN_WINDOW, SMSG_MAIL_MAILS_LIST, + SMSG_MAIL_READ_MAIL, 0 }; handledMessages = _messages; @@ -59,6 +60,10 @@ void MailHandler::handleMessage(Net::MessageIn &msg) processMailList(msg); break; + case SMSG_MAIL_READ_MAIL: + processReadMail(msg); + break; + default: break; } @@ -100,6 +105,31 @@ void MailHandler::processMailList(Net::MessageIn &msg) } } +void MailHandler::processReadMail(Net::MessageIn &msg) +{ + UNIMPLIMENTEDPACKET; + + const int sz = msg.readInt16("len") - 101; + msg.readInt32("message id"); + msg.readString(40, "title"); + msg.readString(24, "sender name"); + msg.readInt16("unused?"); + msg.readInt32("unused"); + msg.readInt32("money"); + msg.readInt32("item amount"); + msg.readInt16("item id"); + msg.readInt16("item type"); + msg.readUInt8("identify"); + msg.readUInt8("attribute"); + msg.readUInt8("refine"); + for (int f = 0; f < 4; f ++) + msg.readInt16("card"); + const int msgLen = msg.readUInt8("msg len"); + if (msgLen != sz) + logger->log("error: wrong message size"); + msg.readString(sz, "message"); +} + void MailHandler::refresh() { createOutPacket(CMSG_MAIL_REFRESH_INBOX); diff --git a/src/net/eathena/mailhandler.h b/src/net/eathena/mailhandler.h index 9aecc0705..162eeee41 100644 --- a/src/net/eathena/mailhandler.h +++ b/src/net/eathena/mailhandler.h @@ -60,6 +60,8 @@ class MailHandler final : public MessageHandler, public Net::MailHandler static void processMailOpen(Net::MessageIn &msg); static void processMailList(Net::MessageIn &msg); + + static void processReadMail(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 7b91f5567..897e8fdca 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -88,7 +88,7 @@ int16_t packet_lengths[] = -1, -1, 0, 8, 10, 0, 282, 0, 0, 15, 0, 0, 0, 19, 71, 5, 12, 0, 0, 0, 0, -1, 0, 0, 282, 0, 4, 0, 6, 0, 0, 0, // #0x0240 - -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, -1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 4, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index b2daa3dbf..ef20ce002 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -306,6 +306,7 @@ #define SMSG_CHAT_TALKIE_BOX 0x0191 #define SMSG_MAIL_MAILS_LIST 0x0240 +#define SMSG_MAIL_READ_MAIL 0x0242 #define SMSG_MAIL_OPEN_WINDOW 0x0260 #define SMSG_FAMILY_ASK_FOR_CHILD 0x01f6 |