mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-23 21:46:27 +00:00
feat (Module\Conf): Alert Fequency
Once Ingame warngings and report in chat min is met, this will throttle to alert the gms every other count, Example so with 5 being the default, u will get a message alert for every 5 violations. Inspired and approved by project nemesis devs Co-Authored-By: Sven <36102838+sven295@users.noreply.github.com> Co-Authored-By: Jinnaix <37972361+jinnaix@users.noreply.github.com>
This commit is contained in:
@@ -193,15 +193,23 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem
|
||||
{
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
{
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Control Hack Detected!";
|
||||
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))
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_IGNORECONTROL, player->GetName().c_str());
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Control Hack Detected!";
|
||||
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());
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
@@ -258,15 +266,23 @@ void AnticheatMgr::ZAxisHackDetection(Player* player, MovementInfo movementInfo)
|
||||
{
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
{
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Zaxis Hack Detected!";
|
||||
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))
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str(), player->GetName().c_str());
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Zaxis Hack Detected!";
|
||||
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(), player->GetName().c_str());
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
@@ -327,15 +343,23 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
|
||||
{
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
{
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Teleport Hack Detected!";
|
||||
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))
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_TELEPORT, player->GetName().c_str());
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Teleport Hack Detected!";
|
||||
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());
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
@@ -664,15 +688,23 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType)
|
||||
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
{
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible cheater!";
|
||||
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))
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str(), player->GetName().c_str());
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible cheater!";
|
||||
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(), player->GetName().c_str());
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user