From b8176c75b6501146ebf610509e2d3218bf764e46 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Mar 2015 16:08:08 +0300 Subject: eathena: add partial support for packet SMSG_MAIL_MAILS_LIST 0x0240. --- src/net/eathena/mailhandler.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/net/eathena/mailhandler.cpp') diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index cf4fb90d4..95c729c9b 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -40,6 +40,7 @@ MailHandler::MailHandler() : static const uint16_t _messages[] = { SMSG_MAIL_OPEN_WINDOW, + SMSG_MAIL_MAILS_LIST, 0 }; handledMessages = _messages; @@ -54,6 +55,10 @@ void MailHandler::handleMessage(Net::MessageIn &msg) processMailOpen(msg); break; + case SMSG_MAIL_MAILS_LIST: + processMailList(msg); + break; + default: break; } @@ -77,6 +82,24 @@ void MailHandler::processMailOpen(Net::MessageIn &msg) } } +void MailHandler::processMailList(Net::MessageIn &msg) +{ + UNIMPLIMENTEDPACKET; + + const int count = (msg.readInt16("len") - 8) / 73; + const int amount = msg.readInt32("amount"); + if (count != amount) + logger->log("error: wrong mails count"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("message id"); + msg.readString(40, "title"); + msg.readUInt8("unread flag"); + msg.readString(24, "sender name"); + msg.readInt32("time stamp"); + } +} + void MailHandler::refresh() { createOutPacket(CMSG_MAIL_REFRESH_INBOX); -- cgit v1.2.3-70-g09d2