summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-06 22:53:18 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-06 22:53:18 +0300
commitfbe1f9697c8a4f675d21c35a54d923fecd7af12e (patch)
tree010876080998bc3242ca1669497f4c26d04b33c5 /src/net
parent8ad5521d3bbb57040c746de4af2c82d0a8477936 (diff)
downloadplus-fbe1f9697c8a4f675d21c35a54d923fecd7af12e.tar.gz
plus-fbe1f9697c8a4f675d21c35a54d923fecd7af12e.tar.bz2
plus-fbe1f9697c8a4f675d21c35a54d923fecd7af12e.tar.xz
plus-fbe1f9697c8a4f675d21c35a54d923fecd7af12e.zip
Add packet SMSG_FORMAT_MESSAGE_STRING 0x02c2.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/chatrecv.cpp11
-rw-r--r--src/net/eathena/chatrecv.h1
-rw-r--r--src/net/eathena/packetsin.inc1
3 files changed, 13 insertions, 0 deletions
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");
diff --git a/src/net/eathena/chatrecv.h b/src/net/eathena/chatrecv.h
index 462a2b360..bf8b13627 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 processFormatMessageString(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 187a5d382..b60298c6b 100644
--- a/src/net/eathena/packetsin.inc
+++ b/src/net/eathena/packetsin.inc
@@ -292,6 +292,7 @@ packet(SMSG_BOOKING_ADD_FILTERING_LIST, 0x090b, 30, nullptr,
packet(SMSG_BOOKING_SUB_FILTERING_LIST, 0x090c, 30, nullptr, 0);
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);
// 3
if (packetVersion >= 3)