feat: New logging,conf, and world sql

Apply additional SQL to world db for in chat gm reporting.
In game gm chat messages with conf for minimal and maximum chat spam once reportable limit is met. Default min report in chat is 70 and max being 80 so it will only in game chat spam GM's 10 times, Adjustable per conf
This commit is contained in:
MDIC
2022-02-25 17:58:25 -05:00
parent 765128144d
commit 27286b4f93
3 changed files with 33 additions and 0 deletions

View File

@@ -31,6 +31,15 @@ Anticheat.ReportsForIngameWarnings = 70
Anticheat.MaxReportsForDailyReport = 70
# Anticheat.ReportinChat
# Description: min and max total reports to trigger gm chat message spam.
# Default: So with 70 being min and 80 being max, it will spam gm in chat 10 times.
# Anticheat.ReportinChat.Min = 70
# Anticheat.ReportinChat.Max = 80
Anticheat.ReportinChat.Min = 70
Anticheat.ReportinChat.Max = 80
# Anticheat.LoginMessage
# Description: Enable login message "This server is running an Anticheat module."
# Default: 1

View File

@@ -0,0 +1,5 @@
DELETE FROM `acore_string` WHERE `entry` IN (30087,30088,30089);
INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES
(30087, '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r |cFFFF8C00 %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30088, '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE TELEPORT HACK DETECTED|cFFFF8C00 %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30089, '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE IGNORE CONTROL HACK DETECTED|cFFFF8C00] %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

View File

@@ -20,6 +20,10 @@
#define CLIMB_ANGLE 1.87f
#define LANG_ANTICHEAT_ALERT 30087
#define LANG_ANTICHEAT_TELEPORT 30088
#define LANG_ANTICHEAT_IGNORECONTROL 30089
AnticheatMgr::AnticheatMgr()
{
}
@@ -203,6 +207,11 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sConfigMgr->GetOption<uint32>("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption<uint32>("Anticheat.ReportinChat.Max", 80))
{
sWorld->SendGMText(LANG_ANTICHEAT_IGNORECONTROL, player->GetName().c_str());
}
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
LOG_INFO("module", "AnticheatMgr:: Ignore Control - Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
@@ -242,6 +251,11 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sConfigMgr->GetOption<uint32>("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption<uint32>("Anticheat.ReportinChat.Max", 80))
{
sWorld->SendGMText(LANG_ANTICHEAT_TELEPORT, player->GetName().c_str());
}
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
LOG_INFO("module", "AnticheatMgr:: Teleport-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
@@ -522,6 +536,11 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType)
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sConfigMgr->GetOption<uint32>("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption<uint32>("Anticheat.ReportinChat.Max", 80))
{
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str());
}
}
}