Add new spam words (#3204)

This commit is contained in:
Ryan 2024-06-02 13:11:40 -04:00 committed by GitHub
parent f24c287e70
commit 6110db55fc

View File

@ -1,19 +1,19 @@
#pragma once #pragma once
#include "file_manager/file.hpp"
#include "services/players/player_service.hpp"
#include "core/enums.hpp" #include "core/enums.hpp"
#include "packet.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "fiber_pool.hpp"
#include "core/scr_globals.hpp" #include "core/scr_globals.hpp"
#include "fiber_pool.hpp"
#include "file_manager/file.hpp"
#include "natives.hpp"
#include "packet.hpp"
#include "script.hpp"
#include "services/players/player_service.hpp"
#include <network/CNetGamePlayer.hpp> #include <network/CNetGamePlayer.hpp>
#include <script/HudColor.hpp>
#include <network/ChatData.hpp> #include <network/ChatData.hpp>
#include <script/HudColor.hpp>
#include <script/globals/GPBD_FM_3.hpp> #include <script/globals/GPBD_FM_3.hpp>
namespace namespace
{ {
static void gamer_handle_serialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf) static void gamer_handle_serialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf)
@ -26,24 +26,18 @@ namespace
} }
} }
static const char* spam_texts[] = static const char* spam_texts[] = {
{
"qq", //a chinese chat app "qq", //a chinese chat app
"QQ",
"WWW.",
"www.", "www.",
".cn", ".cn",
".CN",
".cc", ".cc",
".CC", ".com",
".TOP",
".COM",
".top", ".top",
"\xE3\x80\x90", //left bracket in Chinese input method "\xE3\x80\x90", //left bracket in Chinese input method
"/Menu", "/menu",
"Money/", "money/",
"Money\\\\", "money\\\\",
"Money\\", "money\\",
".gg", ".gg",
"--->", "--->",
"shopgta5", "shopgta5",
@ -56,23 +50,25 @@ namespace
"<font s", "<font s",
"sellix.io", "sellix.io",
"ezcars", "ezcars",
"PLANO INICIAL", // "initial plan" "plano inicial", // "initial plan"
"REP +", "rep +",
"20R$", // Brazil currency? "20r$", // Brazil currency?
"l55.me", "l55.me",
"TRUSTPILOT", "trustpilot",
"cashlounge", "cashlounge",
"Fast Delivery", "fast delivery",
"yosativa", "yosativa",
"rich2day", "rich2day",
"LevelLifters", "levellifters",
". com", ". com",
"$1,000,000,000", "$1,000,000,000",
"Instant Delivery", "instant delivery",
"0 Ban Risk", "0 ban risk",
"Discord For Cheap Money", "discord for cheap money",
"10-30m", "10-30m",
"Discord todo", "hey guys! tired of being poor?",
"gta cash",
"discord todo",
"\xE6\x89\xA3\xE6\x89\xA3", // QQ "\xE6\x89\xA3\xE6\x89\xA3", // QQ
"\xE4\xBC\xA0\xE5\xAA\x92", // AV "\xE4\xBC\xA0\xE5\xAA\x92", // AV
"\xE8\x96\x87\xE4\xBF\xA1", // Wechat "\xE8\x96\x87\xE4\xBF\xA1", // Wechat
@ -116,6 +112,7 @@ namespace
"\xE5\x81\xB7\xE6\x8B\x8D", // AV "\xE5\x81\xB7\xE6\x8B\x8D", // AV
"\xE4\xBC\xA0\xE7\x85\xA4", // AV "\xE4\xBC\xA0\xE7\x85\xA4", // AV
"\xE4\xB9\xB1\xE8\xAE\xBA", // AV "\xE4\xB9\xB1\xE8\xAE\xBA", // AV
"\xE6\x83\x85\xE8\x89\xB2", // Erotic
}; };
} }
@ -143,9 +140,12 @@ namespace big::chat
} }
} }
for (auto e : spam_texts) for (auto e : spam_texts)
if (strstr(text, e) != 0) {
std::string e_str(e);
std::transform(e_str.begin(), e_str.end(), e_str.begin(), ::tolower);
if (strstr(text, e_str.c_str()) != 0)
return SpamReason::STATIC_DETECTION; return SpamReason::STATIC_DETECTION;
}
return SpamReason::NOT_A_SPAMMER; return SpamReason::NOT_A_SPAMMER;
} }