mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 09:07:22 +00:00
fix(build): LOG
fix(build)
This commit is contained in:
@@ -39,7 +39,7 @@ void AnticheatMgr::JumpHackDetection(Player* player, MovementInfo /* movementInf
|
|||||||
if (m_Players[key].GetLastOpcode() == MSG_MOVE_JUMP && opcode == MSG_MOVE_JUMP)
|
if (m_Players[key].GetLastOpcode() == MSG_MOVE_JUMP && opcode == MSG_MOVE_JUMP)
|
||||||
{
|
{
|
||||||
BuildReport(player, JUMP_HACK_REPORT);
|
BuildReport(player, JUMP_HACK_REPORT);
|
||||||
sLog->outString("AnticheatMgr:: Jump-Hack detected player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Jump-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme
|
|||||||
if (sConfigMgr->GetOption<bool>("Anticheat.KickPlayerWaterWalkHack", false))
|
if (sConfigMgr->GetOption<bool>("Anticheat.KickPlayerWaterWalkHack", false))
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
||||||
sLog->outString("AnticheatMgr:: Walk on Water - Hack detected and counteracted by kicking player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Walk on Water - Hack detected and counteracted by kicking player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
|
|
||||||
player->GetSession()->KickPlayer(true);
|
player->GetSession()->KickPlayer(true);
|
||||||
if(sConfigMgr->GetOption<bool>("Anticheat.AnnounceKick", true))
|
if(sConfigMgr->GetOption<bool>("Anticheat.AnnounceKick", true))
|
||||||
@@ -80,7 +80,7 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false)) {
|
else if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false)) {
|
||||||
sLog->outString("AnticheatMgr:: Walk on Water - Hack detected player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Walk on Water - Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
}
|
}
|
||||||
BuildReport(player, WALK_WATER_HACK_REPORT);
|
BuildReport(player, WALK_WATER_HACK_REPORT);
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
|
|||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
||||||
{
|
{
|
||||||
sLog->outString("AnticheatMgr:: Fly-Hack detected and counteracted by kicking player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Fly-Hack detected and counteracted by kicking player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
player->GetSession()->KickPlayer(true);
|
player->GetSession()->KickPlayer(true);
|
||||||
@@ -129,10 +129,11 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
|
|||||||
" has been kicked.|r";
|
" has been kicked.|r";
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str());
|
sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str());
|
||||||
}
|
}
|
||||||
} else if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
}
|
||||||
{
|
else if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
||||||
sLog->outString( "AnticheatMgr:: Fly-Hack detected player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
{
|
||||||
}
|
LOG_INFO("module", "AnticheatMgr:: Fly-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
|
}
|
||||||
|
|
||||||
BuildReport(player,FLY_HACK_REPORT);
|
BuildReport(player,FLY_HACK_REPORT);
|
||||||
}
|
}
|
||||||
@@ -163,7 +164,7 @@ void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movem
|
|||||||
if (z_diff > 1.0f)
|
if (z_diff > 1.0f)
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
||||||
sLog->outString("AnticheatMgr:: Teleport To Plane - Hack detected player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Teleport To Plane - Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
|
|
||||||
BuildReport(player, TELEPORT_PLANE_HACK_REPORT);
|
BuildReport(player, TELEPORT_PLANE_HACK_REPORT);
|
||||||
}
|
}
|
||||||
@@ -226,7 +227,7 @@ void AnticheatMgr::ClimbHackDetection(Player *player, MovementInfo movementInfo,
|
|||||||
if (angle > CLIMB_ANGLE)
|
if (angle > CLIMB_ANGLE)
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
||||||
sLog->outString("AnticheatMgr:: Climb-Hack detected player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Climb-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
|
|
||||||
BuildReport(player, CLIMB_HACK_REPORT);
|
BuildReport(player, CLIMB_HACK_REPORT);
|
||||||
}
|
}
|
||||||
@@ -275,7 +276,7 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
|
|||||||
if (clientSpeedRate > speedRate)
|
if (clientSpeedRate > speedRate)
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", false))
|
||||||
sLog->outString("AnticheatMgr:: Speed-Hack detected player %s (%s)", player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
LOG_INFO("module", "AnticheatMgr:: Speed-Hack detected player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||||
|
|
||||||
BuildReport(player, SPEED_HACK_REPORT);
|
BuildReport(player, SPEED_HACK_REPORT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ public:
|
|||||||
LOG_INFO("module", "Anticheat: Resetting daily report states.");
|
LOG_INFO("module", "Anticheat: Resetting daily report states.");
|
||||||
sAnticheatMgr->ResetDailyReportStates();
|
sAnticheatMgr->ResetDailyReportStates();
|
||||||
UpdateReportResetTime();
|
UpdateReportResetTime();
|
||||||
FMT_LOG_INFO("module", "Anticheat: Next daily report reset: {}", Acore::Time::TimeToHumanReadable(resetTime));
|
LOG_INFO("module", "Anticheat: Next daily report reset: {}", Acore::Time::TimeToHumanReadable(resetTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameTime::GetUptime() > lastIterationPlayer)
|
if (GameTime::GetUptime() > lastIterationPlayer)
|
||||||
{
|
{
|
||||||
lastIterationPlayer = GameTime::GetUptime() + Seconds(sConfigMgr->GetOption<uint32>("Anticheat.SaveReportsTime", 60));
|
lastIterationPlayer = GameTime::GetUptime() + Seconds(sConfigMgr->GetOption<uint32>("Anticheat.SaveReportsTime", 60));
|
||||||
|
|
||||||
FMT_LOG_INFO("module", "Saving reports for {} players.", sWorld->GetPlayerCount());
|
LOG_INFO("module", "Saving reports for {} players.", sWorld->GetPlayerCount());
|
||||||
|
|
||||||
for (SessionMap::const_iterator itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
|
for (SessionMap::const_iterator itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
|
||||||
if (Player* plr = itr->second->GetPlayer())
|
if (Player* plr = itr->second->GetPlayer())
|
||||||
|
|||||||
Reference in New Issue
Block a user