mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 00:58:35 +00:00
fix(build): remove unusued variables and functions parameters
This commit is contained in:
@@ -79,18 +79,17 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
|
|||||||
if (!sConfigMgr->GetBoolDefault("Anticheat.DetectFlyHack", true))
|
if (!sConfigMgr->GetBoolDefault("Anticheat.DetectFlyHack", true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 key = player->GetGUIDLow();
|
|
||||||
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
|
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;
|
return;
|
||||||
|
|
||||||
/*Thanks to @LilleCarl for info to check extra flag*/
|
/*Thanks to @LilleCarl for info to check extra flag*/
|
||||||
bool stricterChecks = true;
|
bool stricterChecks = true;
|
||||||
if (sConfigMgr->GetBoolDefault("Anticheat.StricterFlyHackCheck", false))
|
if (sConfigMgr->GetBoolDefault("Anticheat.StricterFlyHackCheck", false))
|
||||||
stricterChecks = !(movementInfo.HasMovementFlag(MOVEMENTFLAG_ASCENDING) && !player->IsInWater());
|
stricterChecks = !(movementInfo.HasMovementFlag(MOVEMENTFLAG_ASCENDING) && !player->IsInWater());
|
||||||
|
|
||||||
if (!movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING) && stricterChecks)
|
if (!movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING) && stricterChecks)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (sConfigMgr->GetBoolDefault("Anticheat.KickPlayerFlyHack", false))
|
if (sConfigMgr->GetBoolDefault("Anticheat.KickPlayerFlyHack", false))
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
||||||
@@ -131,7 +130,7 @@ void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movem
|
|||||||
{
|
{
|
||||||
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
||||||
sLog->outString("AnticheatMgr:: Teleport To Plane - Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
sLog->outString("AnticheatMgr:: Teleport To Plane - Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
||||||
|
|
||||||
BuildReport(player, TELEPORT_PLANE_HACK_REPORT);
|
BuildReport(player, TELEPORT_PLANE_HACK_REPORT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,7 +193,7 @@ void AnticheatMgr::ClimbHackDetection(Player *player, MovementInfo movementInfo,
|
|||||||
{
|
{
|
||||||
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
if (sConfigMgr->GetBoolDefault("Anticheat.WriteLog", false))
|
||||||
sLog->outString("AnticheatMgr:: Climb-Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
sLog->outString("AnticheatMgr:: Climb-Hack detected player %s (%u)", player->GetName().c_str(), player->GetGUIDLow());
|
||||||
|
|
||||||
BuildReport(player, CLIMB_HACK_REPORT);
|
BuildReport(player, CLIMB_HACK_REPORT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,20 +32,20 @@ public:
|
|||||||
: WorldScript("AnticheatWorldScript")
|
: WorldScript("AnticheatWorldScript")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
void OnUpdate(uint32 diff) override
|
void OnUpdate(uint32 /* diff */) override // unusued parameter
|
||||||
{
|
{
|
||||||
if (sWorld->GetGameTime() > resetTime)
|
if (sWorld->GetGameTime() > resetTime)
|
||||||
{
|
{
|
||||||
sLog->outString( "Anticheat: Resetting daily report states.");
|
sLog->outString( "Anticheat: Resetting daily report states.");
|
||||||
sAnticheatMgr->ResetDailyReportStates();
|
sAnticheatMgr->ResetDailyReportStates();
|
||||||
UpdateReportResetTime();
|
UpdateReportResetTime();
|
||||||
sLog->outString( "Anticheat: Next daily report reset: %u", resetTime);
|
sLog->outString( "Anticheat: Next daily report reset: %ld", resetTime);
|
||||||
}
|
}
|
||||||
if (sWorld->GetUptime() > lastIterationPlayer)
|
if (sWorld->GetUptime() > lastIterationPlayer)
|
||||||
{
|
{
|
||||||
lastIterationPlayer = sWorld->GetUptime() + sConfigMgr->GetIntDefault("Anticheat.SaveReportsTime", 60);
|
lastIterationPlayer = sWorld->GetUptime() + sConfigMgr->GetIntDefault("Anticheat.SaveReportsTime", 60);
|
||||||
sLog->outString( "Saving reports for %u players.", sWorld->GetPlayerCount());
|
sLog->outString( "Saving reports for %u 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())
|
||||||
sAnticheatMgr->SavePlayerData(plr);
|
sAnticheatMgr->SavePlayerData(plr);
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
}
|
}
|
||||||
/* end from skeleton module */
|
/* end from skeleton module */
|
||||||
}
|
}
|
||||||
void OnAfterConfigLoad(bool reload) override
|
void OnAfterConfigLoad(bool /* reload */) override // unusued parameter
|
||||||
{
|
{
|
||||||
sLog->outString("AnticheatModule Loaded.");
|
sLog->outString("AnticheatModule Loaded.");
|
||||||
}
|
}
|
||||||
@@ -94,4 +94,4 @@ void startAnticheatScripts()
|
|||||||
new AnticheatWorldScript();
|
new AnticheatWorldScript();
|
||||||
new AnticheatPlayerScript();
|
new AnticheatPlayerScript();
|
||||||
new AnticheatMovementHandlerScript();
|
new AnticheatMovementHandlerScript();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user