mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 09:07:22 +00:00
Merge remote-tracking branch 'origin/master' into github-actions
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# Anticheat Module
|
||||
#  AzerothCore
|
||||
## Anticheat Module
|
||||
- Latest build status with azerothcore: [](https://github.com/azerothcore/mod-anticheat)
|
||||
|
||||
This is a port of the PassiveAnticheat Script from lordpsyan's repo to [AzerothCore](http://www.azerothcore.org)
|
||||
|
||||
|
||||
@@ -88,39 +88,50 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme
|
||||
void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
|
||||
{
|
||||
if (!sConfigMgr->GetBoolDefault("Anticheat.DetectFlyHack", true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->HasAuraType(SPELL_AURA_FLY) || player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || player->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))//overkill but wth
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*Thanks to @LilleCarl for info to check extra flag*/
|
||||
bool stricterChecks = true;
|
||||
if (sConfigMgr->GetBoolDefault("Anticheat.StricterFlyHackCheck", false))
|
||||
stricterChecks = !(movementInfo.HasMovementFlag(MOVEMENTFLAG_ASCENDING) && !player->IsInWater());
|
||||
/*Thanks to @LilleCarl for info to check extra flag*/
|
||||
bool stricterChecks = true;
|
||||
if (sConfigMgr->GetBoolDefault("Anticheat.StricterFlyHackCheck", false))
|
||||
{
|
||||
stricterChecks = !(movementInfo.HasMovementFlag(MOVEMENTFLAG_ASCENDING) && !player->IsInWater());
|
||||
}
|
||||
|
||||
if (!movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING) && stricterChecks)
|
||||
return;
|
||||
if (!movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING) && stricterChecks)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (sConfigMgr->GetBoolDefault("Anticheat.KickPlayerFlyHack", false))
|
||||
{
|
||||
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
||||
sLog->outString("AnticheatMgr:: Fly-Hack detected and counteracted by kicking player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
||||
if (sConfigMgr->GetBoolDefault("Anticheat.KickPlayerFlyHack", false))
|
||||
{
|
||||
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
||||
{
|
||||
sLog->outString("AnticheatMgr:: Fly-Hack detected and counteracted by kicking player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
||||
}
|
||||
|
||||
player->GetSession()->KickPlayer(true);
|
||||
if(sConfigMgr->GetBoolDefault("Anticheat.AnnounceKick", true))
|
||||
{
|
||||
std::string plr = player->GetName();
|
||||
std::string tag_colour = "7bbef7";
|
||||
std::string plr_colour = "ff0000";
|
||||
std::ostringstream stream;
|
||||
stream << "|CFF" << plr_colour << "[AntiCheat]|r|CFF" << tag_colour <<
|
||||
" Player |r|cff" << plr_colour << plr << "|r|cff" << tag_colour <<
|
||||
" has been kicked.|r";
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str());
|
||||
}
|
||||
} else if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false)) {
|
||||
sLog->outString( "AnticheatMgr:: Fly-Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
||||
}
|
||||
player->GetSession()->KickPlayer(true);
|
||||
if(sConfigMgr->GetBoolDefault("Anticheat.AnnounceKick", true))
|
||||
{
|
||||
std::string plr = player->GetName();
|
||||
std::string tag_colour = "7bbef7";
|
||||
std::string plr_colour = "ff0000";
|
||||
std::ostringstream stream;
|
||||
stream << "|CFF" << plr_colour << "[AntiCheat]|r|CFF" << tag_colour <<
|
||||
" Player |r|cff" << plr_colour << plr << "|r|cff" << tag_colour <<
|
||||
" has been kicked.|r";
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str());
|
||||
}
|
||||
} else if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
||||
{
|
||||
sLog->outString( "AnticheatMgr:: Fly-Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
||||
}
|
||||
|
||||
BuildReport(player,FLY_HACK_REPORT);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "AnticheatMgr.h"
|
||||
#include "Object.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Player.h"
|
||||
|
||||
int64 resetTime = 0;
|
||||
int64 lastIterationPlayer = sWorld->GetUptime() + 30;//TODO: change 30 secs static to a configurable option
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Chat.h"
|
||||
#include "AnticheatMgr.h"
|
||||
#include "Configuration/Config.h"
|
||||
#include "Player.h"
|
||||
|
||||
class anticheat_commandscript : public CommandScript
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user