Update: New SQL and Accurate Column Counting

New Character DB sql, accurate column counting for all cheat detections now in db as well (Teleportation, ignore control, zaxis)
This commit is contained in:
MDIC
2022-04-19 12:49:38 -04:00
parent b1654f82b4
commit d589615a87
5 changed files with 19 additions and 19 deletions

View File

@@ -10,6 +10,9 @@ CREATE TABLE IF NOT EXISTS `daily_players_reports` (
`waterwalk_reports` bigint unsigned NOT NULL DEFAULT 0,
`teleportplane_reports` bigint unsigned NOT NULL DEFAULT 0,
`climb_reports` bigint unsigned NOT NULL DEFAULT 0,
`teleport_reports` bigint unsigned NOT NULL DEFAULT 0,
`ignorecontrol_reports` bigint unsigned NOT NULL DEFAULT 0,
`zaxis_reports` bigint unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@@ -25,5 +28,8 @@ CREATE TABLE IF NOT EXISTS `players_reports_status` (
`waterwalk_reports` bigint unsigned NOT NULL DEFAULT 0,
`teleportplane_reports` bigint unsigned NOT NULL DEFAULT 0,
`climb_reports` bigint unsigned NOT NULL DEFAULT 0,
`teleport_reports` bigint unsigned NOT NULL DEFAULT 0,
`ignorecontrol_reports` bigint unsigned NOT NULL DEFAULT 0,
`zaxis_reports` bigint unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View File

@@ -3,7 +3,7 @@
#include "AnticheatMgr.h"
#define MAX_REPORT_TYPES 8
#define MAX_REPORT_TYPES 9
class AnticheatData
{

View File

@@ -514,8 +514,8 @@ void AnticheatMgr::HandlePlayerLogout(Player* player)
}
void AnticheatMgr::SavePlayerData(Player* player)
{// 1 2 3 4 5 6 7 8 9 10
CharacterDatabase.Execute("REPLACE INTO players_reports_status (guid,average,total_reports,speed_reports,fly_reports,jump_reports,waterwalk_reports,teleportplane_reports,climb_reports,creation_time) VALUES ({},{},{},{},{},{},{},{},{},{});", player->GetGUID().GetCounter(), m_Players[player->GetGUID()].GetAverage(), m_Players[player->GetGUID()].GetTotalReports(), m_Players[player->GetGUID()].GetTypeReports(SPEED_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(FLY_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(JUMP_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(WALK_WATER_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(TELEPORT_PLANE_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(CLIMB_HACK_REPORT), m_Players[player->GetGUID()].GetCreationTime());
{// 1 2 3 4 5 6 7 8 9 10 11 12 13
CharacterDatabase.Execute("REPLACE INTO players_reports_status (guid,average,total_reports,speed_reports,fly_reports,jump_reports,waterwalk_reports,teleportplane_reports,climb_reports,teleport_reports,ignorecontrol_reports,zaxis_reports,creation_time) VALUES ({},{},{},{},{},{},{},{},{},{},{},{},{});", player->GetGUID().GetCounter(), m_Players[player->GetGUID()].GetAverage(), m_Players[player->GetGUID()].GetTotalReports(), m_Players[player->GetGUID()].GetTypeReports(SPEED_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(FLY_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(JUMP_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(WALK_WATER_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(TELEPORT_PLANE_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(CLIMB_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(TELEPORT_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(IGNORE_CONTROL_REPORT), m_Players[player->GetGUID()].GetTypeReports(ZAXIS_HACK_REPORT), m_Players[player->GetGUID()].GetCreationTime());
}
uint32 AnticheatMgr::GetTotalReports(ObjectGuid guid)
@@ -538,6 +538,9 @@ bool AnticheatMgr::MustCheckTempReports(uint8 type)
if (type == JUMP_HACK_REPORT)
return false;
if (type == SPEED_HACK_REPORT)
return false;
if (type == TELEPORT_HACK_REPORT)
return false;
@@ -609,8 +612,8 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType)
if (sConfigMgr->GetOption<uint32>("Anticheat.MaxReportsForDailyReport", 70) < m_Players[key].GetTotalReports())
{
if (!m_Players[key].GetDailyReportState())
{// 1 2 3 4 5 6 7 8 9 10
CharacterDatabase.Execute("REPLACE INTO daily_players_reports (guid,average,total_reports,speed_reports,fly_reports,jump_reports,waterwalk_reports,teleportplane_reports,climb_reports,creation_time) VALUES ({},{},{},{},{},{},{},{},{},{});", player->GetGUID().GetCounter(), m_Players[player->GetGUID()].GetAverage(), m_Players[player->GetGUID()].GetTotalReports(), m_Players[player->GetGUID()].GetTypeReports(SPEED_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(FLY_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(JUMP_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(WALK_WATER_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(TELEPORT_PLANE_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(CLIMB_HACK_REPORT), m_Players[player->GetGUID()].GetCreationTime());
{// 1 2 3 4 5 6 7 8 9 10 11 12 13
CharacterDatabase.Execute("REPLACE INTO daily_players_reports (guid,average,total_reports,speed_reports,fly_reports,jump_reports,waterwalk_reports,teleportplane_reports,climb_reports,teleport_reports,ignorecontrol_reports,zaxis_reports,creation_time) VALUES ({},{},{},{},{},{},{},{},{},{},{},{},{});", player->GetGUID().GetCounter(), m_Players[player->GetGUID()].GetAverage(), m_Players[player->GetGUID()].GetTotalReports(), m_Players[player->GetGUID()].GetTypeReports(SPEED_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(FLY_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(JUMP_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(WALK_WATER_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(TELEPORT_PLANE_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(CLIMB_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(TELEPORT_HACK_REPORT), m_Players[player->GetGUID()].GetTypeReports(IGNORE_CONTROL_REPORT), m_Players[player->GetGUID()].GetTypeReports(ZAXIS_HACK_REPORT), m_Players[player->GetGUID()].GetCreationTime());
m_Players[key].SetDailyReportState(true);
}
}

View File

@@ -40,19 +40,6 @@ enum ReportTypes
// MAX_REPORT_TYPES
};
enum DetectionTypes
{
SPEED_HACK_DETECTION = 1,
FLY_HACK_DETECTION = 2,
WALK_WATER_HACK_DETECTION = 4,
JUMP_HACK_DETECTION = 8,
TELEPORT_PLANE_HACK_DETECTION = 16,
CLIMB_HACK_DETECTION = 32,
TELEPORT_HACK_DETECTION = 64,
IGNORE_CONTROL_DETECTION = 128,
ZAXIS_HACK_DETECTION = 256
};
// GUID is the key.
typedef std::map<ObjectGuid, AnticheatData> AnticheatPlayersDataMap;

View File

@@ -278,12 +278,16 @@ public:
uint32 waterwalk_reports = sAnticheatMgr->GetTypeReports(guid, 2);
uint32 teleportplane_reports = sAnticheatMgr->GetTypeReports(guid, 4);
uint32 climb_reports = sAnticheatMgr->GetTypeReports(guid, 5);
uint32 teleport_reports = sAnticheatMgr->GetTypeReports(guid, 6);
uint32 ignorecontrol_reports = sAnticheatMgr->GetTypeReports(guid, 7);
uint32 zaxis_reports = sAnticheatMgr->GetTypeReports(guid, 8);
handler->PSendSysMessage("Information about player %s",player->GetName().c_str());
handler->PSendSysMessage("Average: %f || Total Reports: %u ",average,total_reports);
handler->PSendSysMessage("Speed Reports: %u || Fly Reports: %u || Jump Reports: %u ",speed_reports,fly_reports,jump_reports);
handler->PSendSysMessage("Walk On Water Reports: %u || Teleport To Plane Reports: %u",waterwalk_reports,teleportplane_reports);
handler->PSendSysMessage("Climb Reports: %u", climb_reports);
handler->PSendSysMessage("Teleport Reports: %u || Climb Reports: %u", teleport_reports,climb_reports);
handler->PSendSysMessage("Ignore Control Reports: %u || Ignore Z-Axis Reports: %u", ignorecontrol_reports, zaxis_reports);
return true;
}