diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-27 21:51:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-11-27 21:51:59 +0300 |
commit | d33ffd2ac6230059cce68ecae862d3bdc813b93d (patch) | |
tree | 1e30c7373c78c6d968bc9697ad72a71df4d84e46 /src/net/tmwa/chatrecv.cpp | |
parent | 2734f4a788dad6faf960d53de00da74ebff69bd5 (diff) | |
download | manaplus-d33ffd2ac6230059cce68ecae862d3bdc813b93d.tar.gz manaplus-d33ffd2ac6230059cce68ecae862d3bdc813b93d.tar.bz2 manaplus-d33ffd2ac6230059cce68ecae862d3bdc813b93d.tar.xz manaplus-d33ffd2ac6230059cce68ecae862d3bdc813b93d.zip |
Avoid shop spam in legacy server.
Diffstat (limited to 'src/net/tmwa/chatrecv.cpp')
-rw-r--r-- | src/net/tmwa/chatrecv.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/net/tmwa/chatrecv.cpp b/src/net/tmwa/chatrecv.cpp index e044d5877..b9dd73af5 100644 --- a/src/net/tmwa/chatrecv.cpp +++ b/src/net/tmwa/chatrecv.cpp @@ -44,11 +44,18 @@ #include "net/tmwa/guildmanager.h" +#include "utils/gettext.h" + #include "debug.h" namespace TmwAthena { +namespace ChatRecv +{ + std::string mShopRequestName; +} // namespace ChatRecv + void ChatRecv::processChat(Net::MessageIn &msg) { BLOCK_START("ChatRecv::processChat") @@ -248,6 +255,16 @@ void ChatRecv::processWhisperContinue(const std::string &nick, && chatMsg.find("\302\202") == 0) { chatMsg = chatMsg.erase(0, 2); + if (mShopRequestName != nick) + { + debugMsg(strprintf( + // TRANSLATORS: message about spam player + _("Detected spam from: %s"), + nick.c_str())); + BLOCK_END("ChatRecv::processWhisper") + return; + } + mShopRequestName.clear(); if (showMsg && chatWindow != nullptr) { chatWindow->addWhisper(nick, |