From fbe1f9697c8a4f675d21c35a54d923fecd7af12e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 Apr 2018 22:53:18 +0300 Subject: Add packet SMSG_FORMAT_MESSAGE_STRING 0x02c2. --- src/net/eathena/chatrecv.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/net/eathena/chatrecv.cpp') diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp index eb6892545..faac6f014 100644 --- a/src/net/eathena/chatrecv.cpp +++ b/src/net/eathena/chatrecv.cpp @@ -173,6 +173,17 @@ void ChatRecv::processFormatMessageNumber(Net::MessageIn &msg) processChatContinue(chatMsg, ChatMsgType::BY_SERVER); } +void ChatRecv::processFormatMessageString(Net::MessageIn &msg) +{ + const int strLen = msg.readInt16("len") - 6; + const int msgId = msg.readInt16("msg id"); + const std::string message = msg.readString(strLen, "value"); + // +++ here need load message from configuration file + const std::string chatMsg = strprintf( + "Message #%d, value: %s", msgId, message.c_str()); + processChatContinue(chatMsg, ChatMsgType::BY_SERVER); +} + void ChatRecv::processFormatMessageSkill(Net::MessageIn &msg) { const int skillId = msg.readInt16("skill id"); -- cgit v1.2.3-60-g2f50