From d29f0000a85334cae0388f8a9b50b3f2de39dac7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Nov 2013 18:41:32 +0300 Subject: add workaround for imcomplete chat messages in "new" tmw server. --- src/net/ea/chathandler.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3-70-g09d2