From 2bd8b34e2cc809a0adbebdadf5a777fbb57cf5a8 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Fri, 6 Apr 2018 23:22:34 +0300
Subject: Add packet SMSG_FORMAT_COLOR_MESSAGE 0x09cd.

---
 src/net/eathena/chatrecv.cpp  | 10 ++++++++++
 src/net/eathena/chatrecv.h    |  1 +
 src/net/eathena/packetsin.inc |  1 +
 3 files changed, 12 insertions(+)

(limited to 'src')

diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp
index faac6f014..12ebe2ee9 100644
--- a/src/net/eathena/chatrecv.cpp
+++ b/src/net/eathena/chatrecv.cpp
@@ -173,6 +173,16 @@ void ChatRecv::processFormatMessageNumber(Net::MessageIn &msg)
     processChatContinue(chatMsg, ChatMsgType::BY_SERVER);
 }
 
+void ChatRecv::processFormatColor(Net::MessageIn &msg)
+{
+    const int msgId = msg.readInt16("msg id");
+    msg.readInt32("color");
+    // +++ here need load message from configuration file
+    const std::string chatMsg = strprintf(
+        "Message #%d", msgId);
+    processChatContinue(chatMsg, ChatMsgType::BY_SERVER);
+}
+
 void ChatRecv::processFormatMessageString(Net::MessageIn &msg)
 {
     const int strLen = msg.readInt16("len") - 6;
diff --git a/src/net/eathena/chatrecv.h b/src/net/eathena/chatrecv.h
index bf8b13627..ec8b0528d 100644
--- a/src/net/eathena/chatrecv.h
+++ b/src/net/eathena/chatrecv.h
@@ -48,6 +48,7 @@ namespace EAthena
         void processChatIgnoreList(Net::MessageIn &msg);
         void processFormatMessage(Net::MessageIn &msg);
         void processFormatMessageNumber(Net::MessageIn &msg);
+        void processFormatColor(Net::MessageIn &msg);
         void processFormatMessageString(Net::MessageIn &msg);
         void processFormatMessageSkill(Net::MessageIn &msg);
         void processChatDisplay(Net::MessageIn &msg);
diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc
index b60298c6b..6fe266937 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -293,6 +293,7 @@ packet(SMSG_BOOKING_SUB_FILTERING_LIST,    0x090c,  30, nullptr,
 packet(SMSG_ADD_MAP_MARKER,                0x09c1,  10, &MapRecv::processAddMapMarker,                  0);
 packet(SMSG_GUILD_ONLINE_INFO,             0x016d,  14, &GuildRecv::processOnlineInfo,                  0);
 packet(SMSG_FORMAT_MESSAGE_STRING,         0x02c2,  -1, &ChatRecv::processFormatMessageString,          0);
+packet(SMSG_FORMAT_COLOR_MESSAGE,          0x09cd,   8, &ChatRecv::processFormatColor,                  0);
 
 // 3
 if (packetVersion >= 3)
-- 
cgit v1.2.3-70-g09d2