mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 10:30:01 +01:00
Merge pull request #333 from BenWagner-UX/fixed_wim_spam_protection
fixed: Warcraft Instant Messenger is causing massive spam by sending …
This commit is contained in:
commit
a90ccb1703
@ -351,12 +351,18 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal
|
|||||||
std::string const command = holder.GetCommand();
|
std::string const command = holder.GetCommand();
|
||||||
Player* owner = holder.GetOwner();
|
Player* owner = holder.GetOwner();
|
||||||
if (!helper.ParseChatCommand(command, owner) && holder.GetType() == CHAT_MSG_WHISPER)
|
if (!helper.ParseChatCommand(command, owner) && holder.GetType() == CHAT_MSG_WHISPER)
|
||||||
|
{
|
||||||
|
// To prevent spam caused by WIM
|
||||||
|
if (!(command.rfind("WIM", 0) == 0) &&
|
||||||
|
!(command.rfind("QHpr", 0) == 0)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "Unknown command " << command;
|
out << "Unknown command " << command;
|
||||||
TellMaster(out);
|
TellMaster(out);
|
||||||
helper.ParseChatCommand("help");
|
helper.ParseChatCommand("help");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
chatCommands.pop();
|
chatCommands.pop();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user