diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net/ea/chathandler.cpp | 14 | ||||
-rw-r--r-- | src/net/ea/chathandler.h | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index deaef6984..0c34291c4 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -48,7 +48,8 @@ namespace Ea ChatHandler::ChatHandler() : mSentWhispers(), mShowAllLang(serverConfig.getValue("showAllLang", 0)), - mShowMotd(config.getBoolValue("showmotd")) + mShowMotd(config.getBoolValue("showmotd")), + mSkipping(true) { } @@ -311,7 +312,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, } void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, - const bool channels) const + const bool channels) { BLOCK_START("ChatHandler::processChat") int chatMsgLength = msg.readInt16() - 4; @@ -334,6 +335,15 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, if (normalChat) { + if (chatMsg.find(": ") == std::string::npos && !mShowMotd + && mSkipping && channel.empty()) + { + // skip motd from "new" tmw server + return; + } + + mSkipping = true; + if (chatWindow) { chatWindow->resortChatLog(chatMsg, BY_PLAYER, diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index 3f0e054a5..5ceccc0c2 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -49,7 +49,7 @@ class ChatHandler : public Net::ChatHandler const bool channels) const; virtual void processChat(Net::MessageIn &msg, const bool normalChat, - const bool channels) const; + const bool channels); virtual void processMVP(Net::MessageIn &msg) const; @@ -60,6 +60,7 @@ class ChatHandler : public Net::ChatHandler WhisperQueue mSentWhispers; bool mShowAllLang; bool mShowMotd; + bool mSkipping; }; } // namespace Ea |