diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-15 12:55:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-15 12:55:46 +0300 |
commit | 42407f169ac67d375cba959bc553ffc186436cba (patch) | |
tree | c94cd937e34a70ffbae1e88f7b43b44c5d3c8ca2 /src/net/eathena | |
parent | d23ec275ea4b350dc616e592714724d66de4599a (diff) | |
download | manaplus-42407f169ac67d375cba959bc553ffc186436cba.tar.gz manaplus-42407f169ac67d375cba959bc553ffc186436cba.tar.bz2 manaplus-42407f169ac67d375cba959bc553ffc186436cba.tar.xz manaplus-42407f169ac67d375cba959bc553ffc186436cba.zip |
eathena: add packet CMSG_MAIL_SEND 0x0248.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/mailhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/eathena/mailhandler.h | 4 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index 23e959538..af7a07e7b 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -119,4 +119,20 @@ void MailHandler::resetAttach(const int flag) outMsg.writeInt16(static_cast<int16_t>(flag), "flag"); } +void MailHandler::send(const std::string &name, + const std::string &title, + std::string message) +{ + if (message.size() > 255) + message = message.substr(0, 255); + const int sz = static_cast<int>(message.size()); + + MessageOut outMsg(CMSG_MAIL_SEND); + outMsg.writeInt16(69 + sz); + outMsg.writeString(name, 24, "name"); + outMsg.writeString(title, 40, "title"); + outMsg.writeInt8(sz); + outMsg.writeString(message, sz, "message"); +} + } // namespace EAthena diff --git a/src/net/eathena/mailhandler.h b/src/net/eathena/mailhandler.h index 1b4f9f2b5..b6e4090ad 100644 --- a/src/net/eathena/mailhandler.h +++ b/src/net/eathena/mailhandler.h @@ -52,6 +52,10 @@ class MailHandler final : public MessageHandler, public Net::MailHandler void resetAttach(const int flag) override final; + void send(const std::string &name, + const std::string &title, + std::string message) override final; + protected: void processMailOpen(Net::MessageIn &msg) const; }; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 70ffd74e5..16e5d481c 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -373,6 +373,7 @@ #define CMSG_MAIL_RETURN_MESSAGE 0x0273 #define CMSG_MAIL_SET_ATTACH 0x0247 #define CMSG_MAIL_RESET_ATTACH 0x0246 +#define CMSG_MAIL_SEND 0x0248 #define SMSG_SOLVE_CHAR_NAME 0x0194 #define SMSG_SKILL_CASTING 0x07fb |