summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-13 23:03:43 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-13 23:03:43 +0300
commit857b503b43dc7e2a452f1897efc2100b028f843a (patch)
tree7af2481fbd6f6fd057f1dc7a9047e54c6fbaf378 /src/net
parentcc597ceb752585ebf247dfbad6185d31e57e8ed8 (diff)
downloadmv-857b503b43dc7e2a452f1897efc2100b028f843a.tar.gz
mv-857b503b43dc7e2a452f1897efc2100b028f843a.tar.bz2
mv-857b503b43dc7e2a452f1897efc2100b028f843a.tar.xz
mv-857b503b43dc7e2a452f1897efc2100b028f843a.zip
eathena: add partial support for packet SMSG_FORMAT_MESSAGE 0x0291.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/chathandler.cpp14
-rw-r--r--src/net/eathena/chathandler.h2
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h1
4 files changed, 18 insertions, 1 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index beae2731b..df1c45155 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -60,6 +60,7 @@ ChatHandler::ChatHandler() :
SMSG_IGNORE_ALL_RESPONSE,
SMSG_COLOR_MESSAGE,
SMSG_CHAT_IGNORE_LIST,
+ SMSG_FORMAT_MESSAGE,
0
};
handledMessages = _messages;
@@ -88,6 +89,10 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
processChat(msg);
break;
+ case SMSG_FORMAT_MESSAGE:
+ processFormatMessage(msg);
+ break;
+
case SMSG_COLOR_MESSAGE:
processColorChat(msg);
break;
@@ -279,6 +284,15 @@ void ChatHandler::processChat(Net::MessageIn &msg)
processChatContinue(msg.readRawString(chatMsgLength, "message"));
}
+void ChatHandler::processFormatMessage(Net::MessageIn &msg)
+{
+ BLOCK_START("ChatHandler::processChat")
+ int msgId = msg.readInt16("msg id");
+ // +++ here need load message from configuration file
+ const std::string chatMsg = strprintf("Message #%d", msgId);
+ processChatContinue(chatMsg);
+}
+
void ChatHandler::processColorChat(Net::MessageIn &msg)
{
BLOCK_START("ChatHandler::processChat")
diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h
index 08103bc86..2238357e7 100644
--- a/src/net/eathena/chathandler.h
+++ b/src/net/eathena/chathandler.h
@@ -86,6 +86,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void processGmChat2(Net::MessageIn &msg);
void processChatIgnoreList(Net::MessageIn &msg);
+
+ void processFormatMessage(Net::MessageIn &msg);
};
} // namespace EAthena
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 36af9a997..aedb16f79 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -94,7 +94,7 @@ int16_t packet_lengths[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// #0x0280
0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -1, -1, 107, 6, -1, 0, 0, 0, 191, 0, 0, 0, 0, 0, 0,
// #0x02C0
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index 20e041374..f6456a924 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -102,6 +102,7 @@
#define SMSG_BEING_ACTION2 0x02e1
#define SMSG_BEING_CHAT 0x008d /**< A being talks */
#define SMSG_COLOR_MESSAGE 0x02c1
+#define SMSG_FORMAT_MESSAGE 0x0291
#define SMSG_BEING_NAME_RESPONSE 0x0095 /**< Has to be requested */
#define SMSG_BEING_NAME_RESPONSE2 0x0220 /**< Has to be requested */
#define SMSG_BEING_CHANGE_DIRECTION 0x009c