summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-11-18 18:41:32 +0300
committerAndrei Karas <akaras@inbox.ru>2013-11-18 18:41:32 +0300
commitd29f0000a85334cae0388f8a9b50b3f2de39dac7 (patch)
tree67dc4bc4961a8715cae162e73bc9a785f2d148fa /src
parent965dacece767acfdb7d9bcbff3073af93a68b41d (diff)
downloadmanaplus-d29f0000a85334cae0388f8a9b50b3f2de39dac7.tar.gz
manaplus-d29f0000a85334cae0388f8a9b50b3f2de39dac7.tar.bz2
manaplus-d29f0000a85334cae0388f8a9b50b3f2de39dac7.tar.xz
manaplus-d29f0000a85334cae0388f8a9b50b3f2de39dac7.zip
add workaround for imcomplete chat messages in "new" tmw server.
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/chathandler.cpp12
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();