diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-14 20:21:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-14 20:26:49 +0300 |
commit | 8d3bbab79c733c7f8c5a685e8243889a250d64c8 (patch) | |
tree | 79622c00c777a52b34dc211da71500b280f2b34b /src | |
parent | f7f9e7eb1e5b42f3fa3f9cd03935c376e12bae44 (diff) | |
download | mv-8d3bbab79c733c7f8c5a685e8243889a250d64c8.tar.gz mv-8d3bbab79c733c7f8c5a685e8243889a250d64c8.tar.bz2 mv-8d3bbab79c733c7f8c5a685e8243889a250d64c8.tar.xz mv-8d3bbab79c733c7f8c5a685e8243889a250d64c8.zip |
For tmwa server version >= 0x100408 not send nick in chat message.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 514b339c8..6ab94b792 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -39,6 +39,7 @@ #include "debug.h" extern Net::ChatHandler *chatHandler; +extern unsigned int tmwServerVersion; namespace TmwAthena { @@ -55,13 +56,23 @@ void ChatHandler::talk(const std::string &restrict text, if (!localPlayer) return; - const std::string mes = std::string(localPlayer->getName()).append( - " : ").append(text); + if (tmwServerVersion >= 0x100408) + { + createOutPacket(CMSG_CHAT_MESSAGE); + // Added + 1 in order to let eAthena parse admin commands correctly + outMsg.writeInt16(CAST_S16(text.length() + 4 + 1), "len"); + outMsg.writeString(text, CAST_S32(text.length() + 1), "message"); + } + else + { + const std::string mes = std::string(localPlayer->getName()).append( + " : ").append(text); - createOutPacket(CMSG_CHAT_MESSAGE); - // Added + 1 in order to let eAthena parse admin commands correctly - outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len"); - outMsg.writeString(mes, CAST_S32(mes.length() + 1), "message"); + createOutPacket(CMSG_CHAT_MESSAGE); + // Added + 1 in order to let eAthena parse admin commands correctly + outMsg.writeInt16(CAST_S16(mes.length() + 4 + 1), "len"); + outMsg.writeString(mes, CAST_S32(mes.length() + 1), "message"); + } } void ChatHandler::talkRaw(const std::string &mes) const |