diff --git a/conf/Anticheat.conf.dist b/conf/Anticheat.conf.dist index 6390580..9090b66 100644 --- a/conf/Anticheat.conf.dist +++ b/conf/Anticheat.conf.dist @@ -19,33 +19,69 @@ Anticheat.Enabled = 1 Anticheat.EnabledOnGmAccounts = 0 -# Anticheat.ReportsForIngameWarnings -# Description: How many reports the player must have to notify to GameMasters ingame when he generates a new report. -# Default: 70 - -Anticheat.ReportsForIngameWarnings = 70 - # Anticheat.MaxReportsForDailyReport # Description: How many reports must the player have to make a report that it is in DB for a day (not only during the player's session). # Default: 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.AlertFrequency -# Description: Once Ingame warngings and report in chat min is met, this will throttle to alert the gms every other count -# Default: So with 1 being the default, u will get a message alert for every 1 violations. -# Anticheat.AlertFrequency = 1 - -Anticheat.AlertFrequency = 1 +# Anticheat.ReportInChatThreshold.Min.[Report type] +# Anticheat.ReportInChatThreshold.Max.[Report type] +# Description: Mininum and maximum thresholds of reports needed to send an alert into the chatboxes of the currently online game masters. +# With a minimum of 50 and a maximum of 60, the game master will receive into their chatbox a maximum of 10 alerts for a given cheat. +# The maximum should not be lower than a minimum value or it would never show the report into the game master's chatbox. + +Anticheat.ReportInChatThreshold.Min.Speed = 50 +Anticheat.ReportInChatThreshold.Max.Speed = 60 +Anticheat.ReportInChatThreshold.Min.Fly = 50 +Anticheat.ReportInChatThreshold.Max.Fly = 60 +Anticheat.ReportInChatThreshold.Min.WaterWalk = 50 +Anticheat.ReportInChatThreshold.Max.WaterWalk = 60 +Anticheat.ReportInChatThreshold.Min.Jump = 50 +Anticheat.ReportInChatThreshold.Max.Jump = 60 +Anticheat.ReportInChatThreshold.Min.TeleportToPlane = 50 +Anticheat.ReportInChatThreshold.Max.TeleportToPlane = 60 +Anticheat.ReportInChatThreshold.Min.Climb = 50 +Anticheat.ReportInChatThreshold.Max.Climb = 60 +Anticheat.ReportInChatThreshold.Min.Teleport = 1 +Anticheat.ReportInChatThreshold.Max.Teleport = 60 +Anticheat.ReportInChatThreshold.Min.IgnoreControl = 50 +Anticheat.ReportInChatThreshold.Max.IgnoreControl = 60 +Anticheat.ReportInChatThreshold.Min.ZAxis = 50 +Anticheat.ReportInChatThreshold.Max.ZAxis = 60 +Anticheat.ReportInChatThreshold.Min.AntiSwim = 50 +Anticheat.ReportInChatThreshold.Max.AntiSwim = 60 +Anticheat.ReportInChatThreshold.Min.Gravity = 50 +Anticheat.ReportInChatThreshold.Max.Gravity = 60 +Anticheat.ReportInChatThreshold.Min.Antiknockback = 50 +Anticheat.ReportInChatThreshold.Max.Antiknockback = 60 +Anticheat.ReportInChatThreshold.Min.NoFallDamage = 1 +Anticheat.ReportInChatThreshold.Max.NoFallDamage = 60 +Anticheat.ReportInChatThreshold.Min.OpAck = 1 +Anticheat.ReportInChatThreshold.Max.OpAck = 60 +Anticheat.ReportInChatThreshold.Min.CounterMeasure = 50 +Anticheat.ReportInChatThreshold.Max.CounterMeasure = 60 + +# Anticheat.AlertFrequency.[Report type] +# Description: When a player triggers an alert, its report type count will increase. +# When that count increases, the game masters will receive an alert of the respective report type into their chatbox if that count is a multiple of the following config. +# If you have an AlertFrequency of 3 and wish to display a specific alert a maximum of 5 times, the ReportInChatThreshold.Max needs to be 15 units higher than its Min counterpart. + +Anticheat.AlertFrequency.Speed = 5 +Anticheat.AlertFrequency.Fly = 5 +Anticheat.AlertFrequency.WaterWalk = 5 +Anticheat.AlertFrequency.Jump = 5 +Anticheat.AlertFrequency.TeleportToPlane = 1 +Anticheat.AlertFrequency.Climb = 5 +Anticheat.AlertFrequency.Teleport = 1 +Anticheat.AlertFrequency.IgnoreControl = 5 +Anticheat.AlertFrequency.ZAxis = 5 +Anticheat.AlertFrequency.AntiSwim = 5 +Anticheat.AlertFrequency.Gravity = 5 +Anticheat.AlertFrequency.Antiknockback = 1 +Anticheat.AlertFrequency.NoFallDamage = 1 +Anticheat.AlertFrequency.OpAck = 1 +Anticheat.AlertFrequency.CounterMeasure = 5 # Anticheat.LoginMessage # Description: Enable login message "This server is running an Anticheat module." diff --git a/sql/updates/world/AC_2023_06_22_00.sql b/sql/updates/world/AC_2023_06_22_00.sql new file mode 100644 index 0000000..17d1ead --- /dev/null +++ b/sql/updates/world/AC_2023_06_22_00.sql @@ -0,0 +1,53 @@ +DELETE FROM `acore_string` WHERE `entry` IN (30087, 30088, 30089, 30090, 30091, 30092); +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|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms - Report: %s', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latence : %u ms - Rapport : %s', + NULL, NULL, NULL, + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latencia: %u ms - Reporte: %s', + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latencia: %u ms - Reporte: %s', + NULL +), +( + 30088, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE TELEPORT HACK DETECTED|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latency: %u ms - GPS Diff x: %f, y: %f, z: %f', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r POSSIBLE TÉLÉPORT HACK DÉTECTÉ|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latence : %u ms - Diff GPS x: %f, y: %f, z: %f', + NULL, NULL, NULL, + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE HACK DE TELEPORTE DETECTADO|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latencia: %u ms - GPS Diff x: %f, y: %f, z: %f', + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE HACK DE TELEPORTE DETECTADO|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latencia: %u ms - GPS Diff x: %f, y: %f, z: %f', + NULL +), +( + 30089, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE IGNORE CONTROL HACK DETECTED|cFFFF8C00 %s|r - Latency: %u ms', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r POSSIBLE IGNORE CONTROL HACK DÉTECTÉ|cFFFF8C00 %s|r - Latence : %u ms', + NULL, NULL, NULL, + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE CONTROL DE HACK DETECTADO IGNORARADO|cFFFF8C00 %s|r - Latencia: %u ms', + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE CONTROL DE HACK DETECTADO IGNORARADO|cFFFF8C00 %s|r - Latencia: %u ms', + NULL +), +( + 30090, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r TELEPORT HACK USED WHILE DUELING|cFFFF8C00 %s|r - Latency: %u ms vs |cFFFF8C00 %s|r - Latency: %u ms.', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r TÉLÉPORT HACK UTILISÉ PENDANT UN DUEL|cFFFF8C00 %s|r - Latence : %u ms vs |cFFFF8C00 %s|r - Latence : %u ms.', + NULL, NULL, NULL, NULL, NULL, NULL +), +( + 30091, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r BG Start Teleport\\Exploit Hack DETECTED|cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r Téléport Début BG\\Exploit Hack DÉTECTÉ|cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latence : %u ms', + NULL, NULL, NULL, NULL, NULL, NULL +), +( + 30092, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r|cFFFF8C00|r %s |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00]', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r|cFFFF8C00|r %s |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00]', + NULL, NULL, NULL, NULL, NULL, NULL +); diff --git a/sql/world/Acore_strings.sql b/sql/world/Acore_strings.sql index e0f4db9..fe31ee0 100644 --- a/sql/world/Acore_strings.sql +++ b/sql/world/Acore_strings.sql @@ -1,9 +1,56 @@ -DELETE FROM `acore_string` WHERE `entry` IN (30087,30088,30089,30090); -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|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms', NULL, NULL, NULL, NULL, NULL, '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms', '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms', NULL), -(30088, '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE TELEPORT HACK DETECTED|cFFFF8C00 %s|r - Latency: %u ms', NULL, NULL, NULL, NULL, NULL, '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE HACK DE TELEPORTE DETECTADO|cFFFF8C00 %s|r - Latency: %u ms', '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE HACK DE TELEPORTE DETECTADO|cFFFF8C00 %s|r - Latency: %u ms', NULL), -(30089, '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE IGNORE CONTROL HACK DETECTED|cFFFF8C00 %s|r - Latency: %u ms', NULL, NULL, NULL, NULL, NULL, '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE CONTROL DE HACK DETECTADO IGNORARADO|cFFFF8C00 %s|r - Latency: %u ms', '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE CONTROL DE HACK DETECTADO IGNORARADO|cFFFF8C00 %s|r - Latency: %u ms', NULL), -(30090, '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r TELEPORT HACK USED WHLE DUELING|cFFFF8C00 %s|r - Latency: %u ms vs |cFFFF8C00 %s|r - Latency: %u ms.', NULL, NULL, NULL, NULL, NULL, '', '', NULL); +DELETE FROM `acore_string` WHERE `entry` IN (30087, 30088, 30089, 30090, 30091, 30092); +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|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms - Report: %s', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latence : %u ms - Rapport : %s', + NULL, NULL, NULL, + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latencia: %u ms - Reporte: %s', + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r |cFFFF8C00|r |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latencia: %u ms - Reporte: %s', + NULL +), +( + 30088, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE TELEPORT HACK DETECTED|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latency: %u ms - GPS Diff x: %f, y: %f, z: %f', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r POSSIBLE TÉLÉPORT HACK DÉTECTÉ|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latence : %u ms - Diff GPS x: %f, y: %f, z: %f', + NULL, NULL, NULL, + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE HACK DE TELEPORTE DETECTADO|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latencia: %u ms - GPS Diff x: %f, y: %f, z: %f', + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE HACK DE TELEPORTE DETECTADO|cFFFF8C00 [|Hplayer:%s|h%s|h|r|cFFFF8C00]|r - Latencia: %u ms - GPS Diff x: %f, y: %f, z: %f', + NULL +), +( + 30089, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r POSSIBLE IGNORE CONTROL HACK DETECTED|cFFFF8C00 %s|r - Latency: %u ms', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r POSSIBLE IGNORE CONTROL HACK DÉTECTÉ|cFFFF8C00 %s|r - Latence : %u ms', + NULL, NULL, NULL, + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE CONTROL DE HACK DETECTADO IGNORARADO|cFFFF8C00 %s|r - Latencia: %u ms', + '|cffffff00[|cffff0000ALERTA ANTITRAMPAS|r|cffffff00]:|r POSIBLE CONTROL DE HACK DETECTADO IGNORARADO|cFFFF8C00 %s|r - Latencia: %u ms', + NULL +), +( + 30090, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r TELEPORT HACK USED WHILE DUELING|cFFFF8C00 %s|r - Latency: %u ms vs |cFFFF8C00 %s|r - Latency: %u ms.', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r TÉLÉPORT HACK UTILISÉ PENDANT UN DUEL|cFFFF8C00 %s|r - Latence : %u ms vs |cFFFF8C00 %s|r - Latence : %u ms.', + NULL, NULL, NULL, NULL, NULL, NULL +), +( + 30091, + '|cffffff00[|cffff0000ANTICHEAT ALERT|r|cffffff00]:|r BG Start Teleport\\Exploit Hack DETECTED|cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latency: %u ms', + NULL, + '|cffffff00[|cffff0000ALERTE ANTICHEAT|r|cffffff00]:|r Téléport Début BG\\Exploit Hack DÉTECTÉ|cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00] - Latence : %u ms', + NULL, NULL, NULL, NULL, NULL, NULL +), +( + 30092, + '|cffffff00[|cffff0000COUNTER MEASURE ALERT|r|cffffff00]:|r |cFFFF8C00|r %s |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00]', + NULL, + '|cffffff00[|cffff0000ALERTE CONTRE MESURE|r|cffffff00]:|r |cFFFF8C00|r %s |cFFFF8C00[|Hplayer:%s|h%s|h|r|cFFFF8C00]', + NULL, NULL, NULL, NULL, NULL, NULL +); DELETE FROM `command` WHERE `name`='anticheat jail'; DELETE FROM `command` WHERE `name`='anticheat delete'; diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 338ba57..76fb2e0 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -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("Anticheat.AlertFrequency.Speed", 5)); + case FLY_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.Fly", 5)); + case WALK_WATER_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.WaterWalk", 5)); + case JUMP_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.Jump", 5)); + case TELEPORT_PLANE_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.TeleportToPlane", 1)); + case CLIMB_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.Climb", 5)); + case TELEPORT_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.Teleport", 1)); + case IGNORE_CONTROL_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.IgnoreControl", 5)); + case ZAXIS_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.ZAxis", 5)); + case ANTISWIM_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.AntiSwim", 5)); + case GRAVITY_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.Gravity", 5)); + case ANTIKNOCK_BACK_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.Antiknockback", 1)); + case NO_FALL_DAMAGE_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.NoFallDamage", 1)); + case OP_ACK_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.OpAck", 1)); + case COUNTER_MEASURES_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.AlertFrequency.CounterMeasure", 5)); + default: + return 1; + } +} + +uint32 AnticheatMgr::GetMinimumReportInChatThresholdConfigFromReportType(ReportTypes reportType) +{ + switch (reportType) + { + case SPEED_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Speed", 50)); + case FLY_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Fly", 50)); + case WALK_WATER_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.WaterWalk", 50)); + case JUMP_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Jump", 50)); + case TELEPORT_PLANE_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.TeleportToPlane", 50)); + case CLIMB_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Climb", 50)); + case TELEPORT_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Teleport", 1)); + case IGNORE_CONTROL_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.IgnoreControl", 50)); + case ZAXIS_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.ZAxis", 50)); + case ANTISWIM_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.AntiSwim", 50)); + case GRAVITY_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Gravity", 50)); + case ANTIKNOCK_BACK_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.Antiknockback", 50)); + case NO_FALL_DAMAGE_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.NoFallDamage", 1)); + case OP_ACK_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Min.OpAck", 1)); + case COUNTER_MEASURES_REPORT: + return std::max(1u, sConfigMgr->GetOption("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("Anticheat.ReportInChatThreshold.Max.Speed", 60)); + case FLY_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.Fly", 60)); + case WALK_WATER_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.WaterWalk", 60)); + case JUMP_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.Jump", 60)); + case TELEPORT_PLANE_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.TeleportToPlane", 60)); + case CLIMB_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.Climb", 60)); + case TELEPORT_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.Teleport", 60)); + case IGNORE_CONTROL_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.IgnoreControl", 60)); + case ZAXIS_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.ZAxis", 60)); + case ANTISWIM_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.AntiSwim", 60)); + case GRAVITY_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.Gravity", 60)); + case ANTIKNOCK_BACK_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.Antiknockback", 60)); + case NO_FALL_DAMAGE_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.NoFallDamage", 60)); + case OP_ACK_HACK_REPORT: + return std::max(1u, sConfigMgr->GetOption("Anticheat.ReportInChatThreshold.Max.OpAck", 60)); + case COUNTER_MEASURES_REPORT: + return std::max(1u, sConfigMgr->GetOption("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("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("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("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption("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("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("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("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("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption("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("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("Anticheat.ReportsForIngameWarnings", 70)) - { - _alertFrequency = sConfigMgr->GetOption("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("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption("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("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("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("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption("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("Anticheat.WriteLog", true)) @@ -1526,25 +1667,7 @@ void AnticheatMgr::BuildReport(Player* player, ReportTypes reportType) } } - if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70)) - { - _alertFrequency = sConfigMgr->GetOption("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("Anticheat.ReportinChat.Min", 70) && m_Players[key].GetTotalReports() <= sConfigMgr->GetOption("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("Anticheat.KickPlayer", true) && m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForKick", 70)) { diff --git a/src/AnticheatMgr.h b/src/AnticheatMgr.h index e87dd95..b33239d 100644 --- a/src/AnticheatMgr.h +++ b/src/AnticheatMgr.h @@ -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 _startPosition; diff --git a/src/cs_anticheat.cpp b/src/cs_anticheat.cpp index 1eb29b5..f2afe0e 100644 --- a/src/cs_anticheat.cpp +++ b/src/cs_anticheat.cpp @@ -200,6 +200,7 @@ class anticheat_commandscript : public CommandScript 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 @@ class anticheat_commandscript : public CommandScript 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 @@ class anticheat_commandscript : public CommandScript } 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 @@ class anticheat_commandscript : public CommandScript 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; }