mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 00:58:35 +00:00
split-thresholds-configs (#120)
This commit is contained in:
@@ -142,6 +142,182 @@ void AnticheatMgr::SendMiddleScreenGMMessage(std::string str)
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
}
|
||||
|
||||
const char* AnticheatMgr::GetReportNameFromReportType(ReportTypes reportType)
|
||||
{
|
||||
switch (reportType)
|
||||
{
|
||||
case SPEED_HACK_REPORT:
|
||||
return "Speed";
|
||||
case FLY_HACK_REPORT:
|
||||
return "Fly";
|
||||
case WALK_WATER_HACK_REPORT:
|
||||
return "Walk On Water";
|
||||
case JUMP_HACK_REPORT:
|
||||
return "Jump";
|
||||
case TELEPORT_PLANE_HACK_REPORT:
|
||||
return "Teleport To Plane";
|
||||
case CLIMB_HACK_REPORT:
|
||||
return "Climb";
|
||||
case TELEPORT_HACK_REPORT:
|
||||
return "Teleport";
|
||||
case IGNORE_CONTROL_REPORT:
|
||||
return "Ignore Control";
|
||||
case ZAXIS_HACK_REPORT:
|
||||
return "Ignore Z-Axis";
|
||||
case ANTISWIM_HACK_REPORT:
|
||||
return "Anti-Swim";
|
||||
case GRAVITY_HACK_REPORT:
|
||||
return "Gravity";
|
||||
case ANTIKNOCK_BACK_HACK_REPORT:
|
||||
return "Anti-Knock Back";
|
||||
case NO_FALL_DAMAGE_HACK_REPORT:
|
||||
return "No Fall Damage";
|
||||
case OP_ACK_HACK_REPORT:
|
||||
return "Op Ack";
|
||||
case COUNTER_MEASURES_REPORT:
|
||||
return "Unknown counter measure"; // Synful-Syn: That is silly. It should not be part of the ReportTypes enum because a counter measure is not a hack.
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
uint32 AnticheatMgr::GetAlertFrequencyConfigFromReportType(ReportTypes reportType)
|
||||
{
|
||||
switch (reportType)
|
||||
{
|
||||
case SPEED_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Speed", 5));
|
||||
case FLY_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Fly", 5));
|
||||
case WALK_WATER_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.WaterWalk", 5));
|
||||
case JUMP_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Jump", 5));
|
||||
case TELEPORT_PLANE_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.TeleportToPlane", 1));
|
||||
case CLIMB_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Climb", 5));
|
||||
case TELEPORT_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Teleport", 1));
|
||||
case IGNORE_CONTROL_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.IgnoreControl", 5));
|
||||
case ZAXIS_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.ZAxis", 5));
|
||||
case ANTISWIM_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.AntiSwim", 5));
|
||||
case GRAVITY_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Gravity", 5));
|
||||
case ANTIKNOCK_BACK_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.Antiknockback", 1));
|
||||
case NO_FALL_DAMAGE_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.NoFallDamage", 1));
|
||||
case OP_ACK_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.OpAck", 1));
|
||||
case COUNTER_MEASURES_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency.CounterMeasure", 5));
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 AnticheatMgr::GetMinimumReportInChatThresholdConfigFromReportType(ReportTypes reportType)
|
||||
{
|
||||
switch (reportType)
|
||||
{
|
||||
case SPEED_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Speed", 50));
|
||||
case FLY_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Fly", 50));
|
||||
case WALK_WATER_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.WaterWalk", 50));
|
||||
case JUMP_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Jump", 50));
|
||||
case TELEPORT_PLANE_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.TeleportToPlane", 50));
|
||||
case CLIMB_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Climb", 50));
|
||||
case TELEPORT_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Teleport", 1));
|
||||
case IGNORE_CONTROL_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.IgnoreControl", 50));
|
||||
case ZAXIS_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.ZAxis", 50));
|
||||
case ANTISWIM_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.AntiSwim", 50));
|
||||
case GRAVITY_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Gravity", 50));
|
||||
case ANTIKNOCK_BACK_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.Antiknockback", 50));
|
||||
case NO_FALL_DAMAGE_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.NoFallDamage", 1));
|
||||
case OP_ACK_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.OpAck", 1));
|
||||
case COUNTER_MEASURES_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Min.CounterMeasure", 50));
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 AnticheatMgr::GetMaximumReportInChatThresholdConfigFromReportType(ReportTypes reportType)
|
||||
{
|
||||
switch (reportType)
|
||||
{
|
||||
case SPEED_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Speed", 60));
|
||||
case FLY_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Fly", 60));
|
||||
case WALK_WATER_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.WaterWalk", 60));
|
||||
case JUMP_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Jump", 60));
|
||||
case TELEPORT_PLANE_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.TeleportToPlane", 60));
|
||||
case CLIMB_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Climb", 60));
|
||||
case TELEPORT_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Teleport", 60));
|
||||
case IGNORE_CONTROL_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.IgnoreControl", 60));
|
||||
case ZAXIS_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.ZAxis", 60));
|
||||
case ANTISWIM_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.AntiSwim", 60));
|
||||
case GRAVITY_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Gravity", 60));
|
||||
case ANTIKNOCK_BACK_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.Antiknockback", 60));
|
||||
case NO_FALL_DAMAGE_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.NoFallDamage", 60));
|
||||
case OP_ACK_HACK_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.OpAck", 60));
|
||||
case COUNTER_MEASURES_REPORT:
|
||||
return std::max(1u, sConfigMgr->GetOption<uint32>("Anticheat.ReportInChatThreshold.Max.CounterMeasure", 60));
|
||||
default:
|
||||
return 80;
|
||||
}
|
||||
}
|
||||
|
||||
void AnticheatMgr::BuildAndSendReportToIngameGameMasters(Player* player, ReportTypes reportType)
|
||||
{
|
||||
ObjectGuid key = player->GetGUID();
|
||||
uint32 counter = m_Players[key].GetTypeReports(reportType);
|
||||
|
||||
if (counter % GetAlertFrequencyConfigFromReportType(reportType) == 0)
|
||||
{
|
||||
const char* reportName = GetReportNameFromReportType(reportType);
|
||||
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible cheater! Report name: " + reportName);
|
||||
|
||||
if (counter >= GetMinimumReportInChatThresholdConfigFromReportType(reportType) && counter <= GetMaximumReportInChatThresholdConfigFromReportType(reportType))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
const char* playerName = player->GetName().c_str();
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, playerName, playerName, latency, reportName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 AnticheatMgr::GetTeleportSkillCooldownDurationInMS(Player* player) const
|
||||
{
|
||||
switch (player->getClass())
|
||||
@@ -740,23 +916,16 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
|
||||
|
||||
if ((xDiff >= 50.0f || yDiff >= 50.0f) && !player->CanTeleport() && !player->IsBeingTeleported())
|
||||
{
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
uint32 counter = m_Players[key].GetTypeReports(TELEPORT_HACK_REPORT);
|
||||
uint32 alertFrequency = GetAlertFrequencyConfigFromReportType(TELEPORT_HACK_REPORT);
|
||||
if (counter % alertFrequency == 0)
|
||||
{
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible Teleport Hack Detected!");
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible Teleport Hack Detected!");
|
||||
|
||||
// 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))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_TELEPORT, player->GetName().c_str(), player->GetName().c_str(), latency, xDiff, yDiff, zDiff);
|
||||
}
|
||||
_counter = 0;
|
||||
if (counter >= GetMinimumReportInChatThresholdConfigFromReportType(TELEPORT_HACK_REPORT) && counter <= GetMaximumReportInChatThresholdConfigFromReportType(TELEPORT_HACK_REPORT))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_TELEPORT, player->GetName().c_str(), player->GetName().c_str(), latency, xDiff, yDiff, zDiff);
|
||||
}
|
||||
}
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
@@ -820,22 +989,15 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem
|
||||
bool unrestricted = newX != lastX || newY != lastY;
|
||||
if (unrestricted)
|
||||
{
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
uint32 counter = m_Players[key].GetTypeReports(IGNORE_CONTROL_REPORT);
|
||||
uint32 alertFrequency = GetAlertFrequencyConfigFromReportType(IGNORE_CONTROL_REPORT);
|
||||
if (counter % alertFrequency == 0)
|
||||
{
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible Ignore Control Hack Detected!");
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible Ignore Control Hack Detected!");
|
||||
|
||||
// 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(), latency);
|
||||
}
|
||||
_counter = 0;
|
||||
if (counter >= GetMinimumReportInChatThresholdConfigFromReportType(IGNORE_CONTROL_REPORT) && counter <= GetMaximumReportInChatThresholdConfigFromReportType(IGNORE_CONTROL_REPORT))
|
||||
{
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_IGNORECONTROL, player->GetName().c_str(), latency);
|
||||
}
|
||||
}
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
@@ -980,25 +1142,8 @@ void AnticheatMgr::ZAxisHackDetection(Player* player, MovementInfo movementInfo)
|
||||
if (m_Players[key].GetLastMovementInfo().pos.GetPositionZ() == movementInfo.pos.GetPositionZ()
|
||||
&& player->GetPositionZ() >= player->GetFloorZ() + 2.5f)
|
||||
{
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
{
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible Ignore Zaxis Hack Detected!");
|
||||
BuildAndSendReportToIngameGameMasters(player, ZAXIS_HACK_REPORT);
|
||||
|
||||
// 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))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str(), player->GetName().c_str(), latency);
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
@@ -1143,23 +1288,19 @@ void AnticheatMgr::NoFallDamageDetection(Player* player, MovementInfo movementIn
|
||||
|
||||
void AnticheatMgr::BGreport(Player* player)
|
||||
{
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
ObjectGuid key = player->GetGUID();
|
||||
uint32 counter = m_Players[key].GetTypeReports(TELEPORT_HACK_REPORT);
|
||||
uint32 alertFrequency = GetAlertFrequencyConfigFromReportType(TELEPORT_HACK_REPORT);
|
||||
if (counter % alertFrequency == 0)
|
||||
{
|
||||
ObjectGuid key = player->GetGUID();
|
||||
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Player Outside of Starting SPOT before BG has started!");
|
||||
|
||||
// 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))
|
||||
if (counter >= GetMinimumReportInChatThresholdConfigFromReportType(TELEPORT_HACK_REPORT) && counter <= GetMaximumReportInChatThresholdConfigFromReportType(TELEPORT_HACK_REPORT))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
@@ -1526,25 +1667,7 @@ void AnticheatMgr::BuildReport(Player* player, ReportTypes reportType)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForIngameWarnings", 70))
|
||||
{
|
||||
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
|
||||
// So we dont divide by 0 by accident
|
||||
if (_alertFrequency < 1)
|
||||
_alertFrequency = 1;
|
||||
if (++_counter % _alertFrequency == 0)
|
||||
{
|
||||
SendMiddleScreenGMMessage("|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + player->GetName() + "|cFF00FFFF] Possible cheater!");
|
||||
|
||||
// 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))
|
||||
{
|
||||
uint32 latency = player->GetSession()->GetLatency();
|
||||
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str(), player->GetName().c_str(), latency);
|
||||
}
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
BuildAndSendReportToIngameGameMasters(player, reportType);
|
||||
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.KickPlayer", true) && m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForKick", 70))
|
||||
{
|
||||
|
||||
@@ -105,6 +105,8 @@ class AnticheatMgr
|
||||
float GetAverage(ObjectGuid guid);
|
||||
uint32 GetTypeReports(ObjectGuid guid, ReportTypes type);
|
||||
|
||||
[[nodiscard]] const char* GetReportNameFromReportType(ReportTypes reportType);
|
||||
|
||||
void AnticheatGlobalCommand(ChatHandler* handler);
|
||||
void AnticheatDeleteCommand(ObjectGuid guid);
|
||||
void AnticheatPurgeCommand(ChatHandler* handler);
|
||||
@@ -132,11 +134,15 @@ class AnticheatMgr
|
||||
void BuildReport(Player* player, ReportTypes reportType);
|
||||
bool MustCheckTempReports(ReportTypes type);
|
||||
void SendMiddleScreenGMMessage(std::string str);
|
||||
|
||||
[[nodiscard]] uint32 GetAlertFrequencyConfigFromReportType(ReportTypes reportType);
|
||||
[[nodiscard]] uint32 GetMinimumReportInChatThresholdConfigFromReportType(ReportTypes reportType);
|
||||
[[nodiscard]] uint32 GetMaximumReportInChatThresholdConfigFromReportType(ReportTypes reportType);
|
||||
void BuildAndSendReportToIngameGameMasters(Player* player, ReportTypes reportType);
|
||||
|
||||
[[nodiscard]] uint32 GetTeleportSkillCooldownDurationInMS(Player* player) const;
|
||||
[[nodiscard]] float GetTeleportSkillDistanceInYards(Player* player) const;
|
||||
[[nodiscard]] float GetPlayerCurrentSpeedRate(Player* player) const;
|
||||
uint32 _counter = 0;
|
||||
uint32 _alertFrequency = 0;
|
||||
uint32 _updateCheckTimer = 4000;
|
||||
uint32 m_MapId;
|
||||
std::array<Position, PVP_TEAMS_COUNT> _startPosition;
|
||||
|
||||
@@ -200,6 +200,7 @@ public:
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
uint32 latency = playerTarget->GetSession()->GetLatency();
|
||||
|
||||
const char* counterMeasureTemplate;
|
||||
const char* lineTemplate_u;
|
||||
const char* lineTemplate_s;
|
||||
const char* lineSeparator;
|
||||
@@ -209,7 +210,8 @@ public:
|
||||
const char* averageTotalTemplate;
|
||||
if (handler->IsConsole())
|
||||
{
|
||||
lineTemplate_u = "%s: %u";
|
||||
counterMeasureTemplate = "Counter Measures Deployed: %u";
|
||||
lineTemplate_u = "%s Reports: %u";
|
||||
lineTemplate_s = "%s: %s";
|
||||
lineSeparator = "-----------------------------------------------------------------";
|
||||
playerInformationTemplate = "Information about player %s";
|
||||
@@ -219,7 +221,8 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTemplate_u = "|cffff0000%s:|cffffff00 %u";
|
||||
counterMeasureTemplate = "|cffff0000Counter Measures Deployed:|cffffff00 %u";
|
||||
lineTemplate_u = "|cffff0000%s Reports:|cffffff00 %u";
|
||||
lineTemplate_s = "|cffff0000%s:|cffffff00 %s";
|
||||
lineSeparator = "|cFFFFA500-----------------------------------------------------------------";
|
||||
playerInformationTemplate = "|cFF20B2AAInformation about player:|cffffff00 %s";
|
||||
@@ -284,52 +287,52 @@ public:
|
||||
|
||||
float average = sAnticheatMgr->GetAverage(guid);
|
||||
uint32 total_reports = sAnticheatMgr->GetTotalReports(guid);
|
||||
uint32 counter_measures_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::COUNTER_MEASURES_REPORT);
|
||||
uint32 counter_measures_reports = sAnticheatMgr->GetTypeReports(guid, COUNTER_MEASURES_REPORT);
|
||||
|
||||
handler->PSendSysMessage(lineTemplate_u, "Counter Measures Deployed", counter_measures_reports);
|
||||
handler->PSendSysMessage(counterMeasureTemplate, counter_measures_reports);
|
||||
handler->PSendSysMessage(averageTotalTemplate, average, total_reports);
|
||||
|
||||
if (uint32 speed_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::SPEED_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Speed Reports", speed_reports);
|
||||
if (uint32 speed_reports = sAnticheatMgr->GetTypeReports(guid, SPEED_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(SPEED_HACK_REPORT), speed_reports);
|
||||
|
||||
if (uint32 fly_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::FLY_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Fly Reports", fly_reports);
|
||||
if (uint32 fly_reports = sAnticheatMgr->GetTypeReports(guid, FLY_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(FLY_HACK_REPORT), fly_reports);
|
||||
|
||||
if (uint32 jump_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::JUMP_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Jump Reports", jump_reports);
|
||||
if (uint32 jump_reports = sAnticheatMgr->GetTypeReports(guid, JUMP_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(JUMP_HACK_REPORT), jump_reports);
|
||||
|
||||
if (uint32 waterwalk_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::WALK_WATER_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Walk On Water Reports", waterwalk_reports);
|
||||
if (uint32 waterwalk_reports = sAnticheatMgr->GetTypeReports(guid, WALK_WATER_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(WALK_WATER_HACK_REPORT), waterwalk_reports);
|
||||
|
||||
if (uint32 teleportplane_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::TELEPORT_PLANE_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Teleport To Plane Reports", teleportplane_reports);
|
||||
if (uint32 teleportplane_reports = sAnticheatMgr->GetTypeReports(guid, TELEPORT_PLANE_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(TELEPORT_PLANE_HACK_REPORT), teleportplane_reports);
|
||||
|
||||
if (uint32 teleport_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::TELEPORT_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Teleport Reports", teleport_reports);
|
||||
if (uint32 teleport_reports = sAnticheatMgr->GetTypeReports(guid, TELEPORT_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(TELEPORT_HACK_REPORT), teleport_reports);
|
||||
|
||||
if (uint32 climb_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::CLIMB_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Climb Reports", climb_reports);
|
||||
if (uint32 climb_reports = sAnticheatMgr->GetTypeReports(guid, CLIMB_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(CLIMB_HACK_REPORT), climb_reports);
|
||||
|
||||
if (uint32 ignorecontrol_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::IGNORE_CONTROL_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Ignore Control Reports", ignorecontrol_reports);
|
||||
if (uint32 ignorecontrol_reports = sAnticheatMgr->GetTypeReports(guid, IGNORE_CONTROL_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(IGNORE_CONTROL_REPORT), ignorecontrol_reports);
|
||||
|
||||
if (uint32 zaxis_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::ZAXIS_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Ignore Z-Axis Reports", zaxis_reports);
|
||||
if (uint32 zaxis_reports = sAnticheatMgr->GetTypeReports(guid, ZAXIS_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(ZAXIS_HACK_REPORT), zaxis_reports);
|
||||
|
||||
if (uint32 antiswim_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::ANTISWIM_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Anti-Swim Reports", antiswim_reports);
|
||||
if (uint32 antiswim_reports = sAnticheatMgr->GetTypeReports(guid, ANTISWIM_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(ANTISWIM_HACK_REPORT), antiswim_reports);
|
||||
|
||||
if (uint32 gravity_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::GRAVITY_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Gravity Reports", gravity_reports);
|
||||
if (uint32 gravity_reports = sAnticheatMgr->GetTypeReports(guid, GRAVITY_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(GRAVITY_HACK_REPORT), gravity_reports);
|
||||
|
||||
if (uint32 antiknockback_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::ANTIKNOCK_BACK_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Anti-Knock Back Reports", antiknockback_reports);
|
||||
if (uint32 antiknockback_reports = sAnticheatMgr->GetTypeReports(guid, ANTIKNOCK_BACK_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(ANTIKNOCK_BACK_HACK_REPORT), antiknockback_reports);
|
||||
|
||||
if (uint32 no_fall_damage_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::NO_FALL_DAMAGE_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "No Fall Damage Reports", no_fall_damage_reports);
|
||||
if (uint32 no_fall_damage_reports = sAnticheatMgr->GetTypeReports(guid, NO_FALL_DAMAGE_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(NO_FALL_DAMAGE_HACK_REPORT), no_fall_damage_reports);
|
||||
|
||||
if (uint32 op_ack_reports = sAnticheatMgr->GetTypeReports(guid, ReportTypes::OP_ACK_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, "Op Ack Reports", op_ack_reports);
|
||||
if (uint32 op_ack_reports = sAnticheatMgr->GetTypeReports(guid, OP_ACK_HACK_REPORT))
|
||||
handler->PSendSysMessage(lineTemplate_u, sAnticheatMgr->GetReportNameFromReportType(OP_ACK_HACK_REPORT), op_ack_reports);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user