summaryrefslogtreecommitdiff
path: root/src/net/eathena/mailhandler.cpp
diff options
context:
space:
mode:
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);