add (conf\cm): Counter Measure Fly Hack

New Counter Measure FlyHACK
New conf: Anticheat.CM.FLYHACK
This commit is contained in:
M'Dic
2023-03-29 14:32:57 -04:00
parent cf755b4d5e
commit 9b4aae9fa8
2 changed files with 34 additions and 0 deletions

View File

@@ -326,6 +326,29 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
LOG_INFO("anticheat.module", "AnticheatMgr:: Fly-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
if (sConfigMgr->GetOption<bool>("Anticheat.CM.FLYHACK", true))
{ // display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] FLY HACK COUNTER MEASURE ALERT";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
Player* cheatertarget = player->GetSession()->GetPlayer();
WorldPacket cheater(12);
cheater.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
cheater << cheatertarget->GetPackGUID();
cheater << uint32(0);
cheatertarget->SendMessageToSet(&cheater, true);
}
if (sConfigMgr->GetOption<bool>("Anticheat.CM.ALERTCHAT", true))
{
std::string str = "|cFFFFFC00 FLY HACK COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
BuildReport(player, FLY_HACK_REPORT);
}