From f726b2f2e39711fc043a36518601d81b57294efd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 25 Sep 2018 22:46:52 +0300 Subject: Add packet SMSG_FORMAT_MESSAGE_STRING_COLOR 0x0a6f. --- src/net/eathena/chatrecv.cpp | 12 ++++++++++++ src/net/eathena/chatrecv.h | 1 + src/net/eathena/packetsin.inc | 1 + 3 files changed, 14 insertions(+) diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp index fdcdfe8ed..092fc0589 100644 --- a/src/net/eathena/chatrecv.cpp +++ b/src/net/eathena/chatrecv.cpp @@ -194,6 +194,18 @@ void ChatRecv::processFormatMessageString(Net::MessageIn &msg) processChatContinue(chatMsg, ChatMsgType::BY_SERVER); } +void ChatRecv::processFormatMessageStringColor(Net::MessageIn &msg) +{ + const int strLen = msg.readInt16("len") - 10; + const int msgId = msg.readInt16("msg id"); + msg.readInt32("color"); + 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"); diff --git a/src/net/eathena/chatrecv.h b/src/net/eathena/chatrecv.h index ec8b0528d..cf306056f 100644 --- a/src/net/eathena/chatrecv.h +++ b/src/net/eathena/chatrecv.h @@ -50,6 +50,7 @@ namespace EAthena void processFormatMessageNumber(Net::MessageIn &msg); void processFormatColor(Net::MessageIn &msg); void processFormatMessageString(Net::MessageIn &msg); + void processFormatMessageStringColor(Net::MessageIn &msg); void processFormatMessageSkill(Net::MessageIn &msg); void processChatDisplay(Net::MessageIn &msg); void processChatRoomJoinAck(Net::MessageIn &msg); diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 191e801f5..b11b20fbd 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -981,6 +981,7 @@ if (packetVersion >= 20151223) if (packetVersion >= 20160330) { packet(SMSG_MAP_LOGIN_SUCCESS, 0x02eb, 13, &GameRecv::processMapLogin, 20160330); + packet(SMSG_FORMAT_MESSAGE_STRING_COLOR, 0x0a6f, -1, &ChatRecv::processFormatMessageStringColor, 20160330); } // 20160622 -- cgit v1.2.3-70-g09d2