summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-14 20:21:19 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-14 20:26:49 +0300
commit8d3bbab79c733c7f8c5a685e8243889a250d64c8 (patch)
tree79622c00c777a52b34dc211da71500b280f2b34b /src/net/tmwa/chathandler.cpp
parentf7f9e7eb1e5b42f3fa3f9cd03935c376e12bae44 (diff)
downloadmv-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/net/tmwa/chathandler.cpp')
-rw-r--r--src/net/tmwa/chathandler.cpp23
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