mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-17 10:45:45 +00:00
Feat (Conf\BG): BG Star Area Cheat Countermeasure
If a player cheats by teleporting outside of the start spot before the BG starts, a counter measure will applied and log (if WriteLog is enabled) and send the player to a void spot for a few seconds and return them back in the team start spot
This commit is contained in:
@@ -936,6 +936,30 @@ void AnticheatMgr::BGreport(Player* player)
|
||||
BuildReport(player, TELEPORT_HACK_REPORT);
|
||||
}
|
||||
|
||||
Position const* AnticheatMgr::GetTeamStartPosition(TeamId teamId) const
|
||||
{
|
||||
return &_startPosition[teamId];
|
||||
}
|
||||
|
||||
void AnticheatMgr::CheckStartPositions(Player* player)
|
||||
{
|
||||
if (!sConfigMgr->GetOption<bool>("Anticheat.BG.StartAreaTeleport", true))
|
||||
return;
|
||||
|
||||
Position pos = player->GetPosition();
|
||||
Position const* startPos = GetTeamStartPosition(player->GetBgTeamId());
|
||||
|
||||
if (pos.GetExactDistSq(!startPos))
|
||||
{
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
{
|
||||
LOG_INFO("anticheat.module", "ANTICHEAT COUNTER MEASURE:: Sending {} back to start location (BG Map: {}) (possible exploit)", player->GetName(), player->GetMapId());
|
||||
}
|
||||
player->TeleportTo(player->GetMapId(), startPos->GetPositionX(), startPos->GetPositionY(), startPos->GetPositionZ(), startPos->GetOrientation());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
{
|
||||
if (!sConfigMgr->GetOption<bool>("Anticheat.DetectBGStartHack", true))
|
||||
@@ -957,12 +981,14 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
(player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionY() < -525.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
if ((player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() > -535.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > -1283.33f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() < -716.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -974,6 +1000,7 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
if (!(movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_Players[key].GetLastOpcode() == MSG_MOVE_JUMP) && movementInfo.pos.GetPositionZ() > 380.0f)
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
if (Battleground* bg = player->GetBattleground())
|
||||
{
|
||||
@@ -985,12 +1012,14 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
(player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionY() < 1450.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
if ((player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > 957.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() < 1416.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() > 1466.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1008,11 +1037,13 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
(player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionY() > 1361.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
if ((player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > 730.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() > 724.8f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1030,12 +1061,14 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
(player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionY() < 1584.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
if ((player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() > 1816.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() > 1554.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() < 1526.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1053,12 +1086,14 @@ void AnticheatMgr::BGStartExploit(Player* player, MovementInfo movementInfo)
|
||||
(player->GetTeamId() == TEAM_ALLIANCE && movementInfo.pos.GetPositionY() > -760.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
if ((player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionX() < 1147.8f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() < -855.0f) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && movementInfo.pos.GetPositionY() > -676.0f))
|
||||
{
|
||||
sAnticheatMgr->BGreport(player);
|
||||
sAnticheatMgr->CheckStartPositions(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user