summaryrefslogtreecommitdiff
path: root/src/net/eathena/mailhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-12 16:08:08 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-12 16:08:08 +0300
commitb8176c75b6501146ebf610509e2d3218bf764e46 (patch)
tree93bad89d9aef1c72b9d88755dd9b4f654a9e0df3 /src/net/eathena/mailhandler.cpp
parent1769c5e53a8a2765a19906fb94f992bbe579eefe (diff)
downloadmanaplus-b8176c75b6501146ebf610509e2d3218bf764e46.tar.gz
manaplus-b8176c75b6501146ebf610509e2d3218bf764e46.tar.bz2
manaplus-b8176c75b6501146ebf610509e2d3218bf764e46.tar.xz
manaplus-b8176c75b6501146ebf610509e2d3218bf764e46.zip
eathena: add partial support for packet SMSG_MAIL_MAILS_LIST 0x0240.
Diffstat (limited to 'src/net/eathena/mailhandler.cpp')
-rw-r--r--src/net/eathena/mailhandler.cpp23
1 files changed, 23 insertions, 0 deletions
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);