update (reporting): BG Report Clean up

code reduction and clean up. no actual functional changes.
This commit is contained in:
M'Dic
2022-09-16 10:10:26 -04:00
parent 99b3157536
commit e83f29cdf0
2 changed files with 48 additions and 328 deletions

View File

@@ -877,6 +877,42 @@ void AnticheatMgr::NoFallDamageDetection(Player* player, MovementInfo movementIn
}
}
void AnticheatMgr::BGreport(Player* player)
{
ObjectGuid key = player->GetGUID();
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG Start Spot Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
}
void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
{
if (!sConfigMgr->GetOption<bool>("Anticheat.DetectBGStartHack", true))
@@ -895,69 +931,12 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
// Outside of starting area before BG has started.
if (player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionX() < 770.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG AV has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG AV Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
if (player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() > -536.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG AV has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
latency = player->GetSession()->GetLatency();
LOG_INFO("anticheat.module", "AnticheatMgr:: BG AV Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
}
}
@@ -968,35 +947,7 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
// Only way to get this high is with engineering items malfunction.
if (!(movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_Players[key].GetLastOpcode() == MSG_MOVE_JUMP) && movementInfo.pos.GetPositionZ() > 380.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG WG has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG WG Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
if (Battleground* bg = player->GetBattleground())
@@ -1006,69 +957,11 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
// Outside of starting area before BG has started.
if (player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionX() < 1490.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG WG has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG WG Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
if (player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > 957.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG WG has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG WG Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
}
}
@@ -1083,69 +976,11 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
// Outside of starting area before BG has started.
if (player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionX() < 1270.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG AB has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG AB Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
if (player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > 730.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG AB has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG AB Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
}
}
@@ -1160,69 +995,11 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
// Outside of starting area before BG has started.
if (player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionX() < 2512.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG EOTS has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG EOTS Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
if (player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > 1816.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG EOTS has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG EOTS Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
}
}
@@ -1237,69 +1014,11 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
// Outside of starting area before BG has started.
if (player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionX() > 412.0f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG IOC has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG IOC Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
if (player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() < 1147.8f)
{
_alertFrequency = sConfigMgr->GetOption<uint32>("Anticheat.AlertFrequency", 5);
// So we dont divide by 0 by accident
if (_alertFrequency < 1)
_alertFrequency = 1;
if (++_counter % _alertFrequency == 0)
{
// display warning at the center of the screen, hacky way?
std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Player Outside of Starting SPOT before BG IOC has started!";
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
data << str;
sWorld->SendGlobalGMMessage(&data);
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
// 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_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
std::string goXYZ = ".go xyz " + std::to_string(player->GetPositionX()) + " " + std::to_string(player->GetPositionY()) + " " + std::to_string(player->GetPositionZ() + 1.0f) + " " + std::to_string(player->GetMap()->GetId()) + " " + std::to_string(player->GetOrientation());
LOG_INFO("anticheat.module", "AnticheatMgr:: BG IOC Start Bound Exploit-Hack detected player {} ({}) - Latency: {} ms - IP: {} - Cheat Flagged At: {}", player->GetName(), player->GetGUID().ToString(), latency, player->GetSession()->GetRemoteAddress().c_str(), goXYZ);
}
BuildReport(player, TELEPORT_HACK_REPORT);
sAnticheatMgr->BGreport(player);
}
}
}