diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-11-18 18:41:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-11-18 18:41:32 +0300 |
commit | d29f0000a85334cae0388f8a9b50b3f2de39dac7 (patch) | |
tree | 67dc4bc4961a8715cae162e73bc9a785f2d148fa /src | |
parent | 965dacece767acfdb7d9bcbff3073af93a68b41d (diff) | |
download | manaverse-d29f0000a85334cae0388f8a9b50b3f2de39dac7.tar.gz manaverse-d29f0000a85334cae0388f8a9b50b3f2de39dac7.tar.bz2 manaverse-d29f0000a85334cae0388f8a9b50b3f2de39dac7.tar.xz manaverse-d29f0000a85334cae0388f8a9b50b3f2de39dac7.zip |
add workaround for imcomplete chat messages in "new" tmw server.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/ea/chathandler.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 265f59cb1..7199d3b5c 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -42,6 +42,8 @@ #include "debug.h" +extern unsigned int tmwServerVersion; + namespace Ea { @@ -287,7 +289,15 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, std::string sender_name = ((pos == std::string::npos) ? "" : chatMsg.substr(0, pos)); - if (sender_name != being->getName() && being->getType() == Being::PLAYER) + if (tmwServerVersion > 0) + { + // work around for "new" tmw server + sender_name = being->getName(); + if (sender_name.empty()) + sender_name = "?"; + } + else if (sender_name != being->getName() + && being->getType() == Being::PLAYER) { if (!being->getName().empty()) sender_name = being->getName(); |