summaryrefslogtreecommitdiff
path: root/src/net/eathena/mailhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-12 16:45:40 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-12 16:45:40 +0300
commit3b77e87f120b096510f5c6af721563683057b101 (patch)
treef3e9d974bb0340baa0173cd6230e5c2d28230a56 /src/net/eathena/mailhandler.cpp
parentb8176c75b6501146ebf610509e2d3218bf764e46 (diff)
downloadmv-3b77e87f120b096510f5c6af721563683057b101.tar.gz
mv-3b77e87f120b096510f5c6af721563683057b101.tar.bz2
mv-3b77e87f120b096510f5c6af721563683057b101.tar.xz
mv-3b77e87f120b096510f5c6af721563683057b101.zip
eathena: add partial support for packet SMSG_MAIL_READ_MAIL 0x0242.
Diffstat (limited to 'src/net/eathena/mailhandler.cpp')
-rw-r--r--src/net/eathena/mailhandler.cpp30
1 files changed, 30 insertions, 0 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);