From 8a294cb2be91ab0744d73672c8a59a3bd70a5325 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Wed, 20 Oct 2021 23:46:53 -0400 Subject: [PATCH] Include emails in chat dump --- src/Email.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Email.cpp b/src/Email.cpp index 59ef054..955b3a2 100644 --- a/src/Email.cpp +++ b/src/Email.cpp @@ -226,10 +226,10 @@ static void emailSend(CNSocket* sock, CNPacketData* data) { INITSTRUCT(sP_FE2CL_REP_PC_SEND_EMAIL_SUCC, resp); + Player otherPlr = {}; + Database::getPlayer(&otherPlr, pkt->iTo_PCUID); if (pkt->iCash || pkt->aItem[0].ItemInven.iID) { // if there are item or taro attachments - Player otherPlr = {}; - Database::getPlayer(&otherPlr, pkt->iTo_PCUID); if (otherPlr.iID != 0 && plr->PCStyle2.iPayzoneFlag != otherPlr.PCStyle2.iPayzoneFlag) { // if the players are not in the same time period INITSTRUCT(sP_FE2CL_REP_PC_SEND_EMAIL_FAIL, resp); @@ -304,6 +304,10 @@ static void emailSend(CNSocket* sock, CNPacketData* data) { resp.iTo_PCUID = pkt->iTo_PCUID; sock->sendPacket(resp, P_FE2CL_REP_PC_SEND_EMAIL_SUCC); + + std::string logEmail = "[Email] " + PlayerManager::getPlayerName(plr, true) + " (to " + PlayerManager::getPlayerName(&otherPlr, true) + "): <" + email.SubjectLine + ">\n" + email.MsgBody; + std::cout << logEmail << std::endl; + Chat::dump.push_back(logEmail); } void Email::init() {