summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-28 00:56:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-29 14:10:27 +0300
commit65d433a88afd4106e86c19eb438efbe1a1925de8 (patch)
tree86fa7547e801e7ced3cbfce7a247029db89c5490 /src/net
parent2761e46993448da413c9da193f0bbc1c89fc1a85 (diff)
downloadmv-65d433a88afd4106e86c19eb438efbe1a1925de8.tar.gz
mv-65d433a88afd4106e86c19eb438efbe1a1925de8.tar.bz2
mv-65d433a88afd4106e86c19eb438efbe1a1925de8.tar.xz
mv-65d433a88afd4106e86c19eb438efbe1a1925de8.zip
eathena: impliment packet SMSG_MAIL_READ_MAIL.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/mailhandler.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp
index 1a24fcc86..f49cc8a5e 100644
--- a/src/net/eathena/mailhandler.cpp
+++ b/src/net/eathena/mailhandler.cpp
@@ -148,27 +148,28 @@ 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?");
+ MailMessage *mail = new MailMessage;
+ mail->id = msg.readInt32("message id");
+ mail->title = msg.readString(40, "title");
+ mail->sender = msg.readString(24, "sender name");
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");
+ mail->money = msg.readInt32("money");
+ mail->itemAmount = msg.readInt32("item amount");
+ mail->itemId = msg.readInt16("item id");
+ mail->itemType = msg.readInt16("item type");
+ mail->itemIdentify = msg.readUInt8("identify");
+ mail->itemAttribute = msg.readUInt8("attribute");
+ mail->itemRefine = msg.readUInt8("refine");
for (int f = 0; f < 4; f ++)
- msg.readInt16("card");
+ mail->card[f] = msg.readInt16("card");
const int msgLen = msg.readUInt8("msg len");
if (msgLen != sz)
logger->log("error: wrong message size");
- msg.readString(sz, "message");
+ mail->text = msg.readString(sz, "message");
+ msg.readUInt8("zero");
+ mail->strTime = timeToStr(mail->time);
+ mailWindow->showMessage(mail);
}
void MailHandler::processGetAttachment(Net::MessageIn &msg)