2022-11-21 15:42:12 +00:00
|
|
|
#pragma once
|
|
|
|
#include "services/players/player_service.hpp"
|
|
|
|
#include "file_manager/file.hpp"
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
static const char* spam_texts[] =
|
|
|
|
{
|
|
|
|
"QQ",
|
|
|
|
"WWW.",
|
|
|
|
"www.",
|
|
|
|
".cn",
|
|
|
|
".CN",
|
|
|
|
".TOP",
|
|
|
|
".COM",
|
2022-12-06 16:12:02 +00:00
|
|
|
".top",
|
2022-11-21 15:42:12 +00:00
|
|
|
"\xE3\x80\x90",
|
|
|
|
"/Menu",
|
|
|
|
"Money/",
|
|
|
|
"Money\\\\",
|
|
|
|
"Money\\",
|
|
|
|
".gg",
|
|
|
|
"--->",
|
|
|
|
"shopgta5",
|
2022-12-19 17:39:06 +00:00
|
|
|
"doit#",
|
|
|
|
"krutka#",
|
2022-12-22 21:23:32 +00:00
|
|
|
"<b>",
|
|
|
|
"\xD0\xBC\xD0\xB5", // Cyrillic "me"
|
|
|
|
"P888",
|
|
|
|
"gtacash",
|
|
|
|
"\xE6\x89\xA3\xE6\x89\xA3", // no clue what this is
|
|
|
|
"\xE5\xBE\xAE\xE4\xBF\xA1", // "wechat" in Chinese
|
|
|
|
".cc",
|
|
|
|
"<font s",
|
|
|
|
"sellix.io",
|
|
|
|
"ezcars",
|
|
|
|
"PLANO INICIAL", // "initial plan"
|
|
|
|
"REP +",
|
2023-01-06 23:25:16 +00:00
|
|
|
"20R$", // Brazil currency?
|
|
|
|
"l55.me"
|
2022-11-21 15:42:12 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace big::spam
|
|
|
|
{
|
|
|
|
inline bool is_text_spam(const char* text)
|
|
|
|
{
|
|
|
|
for (auto e : spam_texts)
|
|
|
|
if (strstr(text, e) != 0)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void log_chat(char* msg, player_ptr player, bool is_spam)
|
|
|
|
{
|
|
|
|
std::ofstream spam_log(g_file_manager->get_project_file(is_spam ? "./spam.log" : "./chat.log").get_path(), std::ios::app);
|
|
|
|
|
|
|
|
auto& plData = *player->get_net_data();
|
|
|
|
|
|
|
|
spam_log << player->get_name() << " (" << plData.m_gamer_handle_2.m_rockstar_id << ") <"
|
|
|
|
<< (int)plData.m_external_ip.m_field1 << "." << (int)plData.m_external_ip.m_field2 << "." << (int)plData.m_external_ip.m_field3 << "." << (int)plData.m_external_ip.m_field4 <<
|
|
|
|
">: " << msg <<
|
|
|
|
std::endl;
|
|
|
|
|
|
|
|
spam_log.close();
|
|
|
|
}
|
|
|
|
}
|