Hi,
I was not active all this time along, I don't know if you are still using this, but you can simplify like this:
if (ch->IncreaseChatCounter() >= 10)
{
if (ch->GetChatCounter() == 10)
{
strlcpy(buf, data + sizeof(TPacketCGChat), MIN(iExtraLen + 1, sizeof(buf)));
std::vector<std::string> stringsToFind = {"(Ȳ´ç)", "(µ·)", "(±â»Ý)", "(ÁÁľĆ)", "(»ç¶ű)", "(şĐłë)", "(ľĆÇĎ)", "(żěżď)", "(ÁËĽŰ)", "(!)", "(?)", "(fish)", "(celebration)", "(alcohol)", "(weather3)", "(letter)", "(hungry)", "(busy)", "(charging)", "(call)", "(weather1)", "(weather2)", "(siren)", "(nosay)", "(whirl)"};
bool found = false;
for(const auto &str : stringsToFind) {
if (std::string(buf).find(str) != std::string::npos) {
found = true;
break;
}
}
if (!found) {
sys_log(0, "CHAT_HACK: %s", ch->GetName());
ch->GetDesc()->DelayedDisconnect(5);
}
}
return iExtraLen;
}