Beispiel #1
0
void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movementInfo)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & TELEPORT_PLANE_HACK_DETECTION) == 0)
        return;

    uint32 key = player->GetGUIDLow();

    if (m_Players[key].GetLastMovementInfo().pos.GetPositionZ() != 0 ||
        movementInfo.pos.GetPositionZ() != 0)
        return;

    if (movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING))
        return;

    //DEAD_FALLING was deprecated
    //if (player->getDeathState() == DEAD_FALLING)
    //    return;
    float x, y, z;
    player->GetPosition(x, y, z);
    float ground_Z = player->GetMap()->GetHeight(x, y, z);
    float z_diff = fabs(ground_Z - z);

    // we are not really walking there
    if (z_diff > 1.0f)
    {
        TC_LOG_DEBUG("entities.player.character", "AnticheatMgr:: Teleport To Plane - Hack detected player GUID (low) %u",player->GetGUIDLow());
        BuildReport(player,TELEPORT_PLANE_HACK_REPORT);
    }
}
Beispiel #2
0
void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
{
    if (player->isGameMaster())
        return;
        
    if (!player->anticheatData.lastMovementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING))
        return;

    if (player->HasAuraType(SPELL_AURA_FLY) ||
        player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) ||
        player->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))
        return;
     
    if (
        player->HasAura(34480) || // GRAVITY_LAPSE
        player->HasAura(39432) || // GRAVITY_LAPSE_AURA
        player->HasAura(33943) || // Flight Form
        player->HasAura(40120) || // Swift Flight Form
        player->HasAura(73446) || // The Pride Of Kezan: Flight Speed Aura
        player->HasAura(44227) // GRAVITY_LAPSE_FLY
        )
        return;        

    sLog->outError("FlyHack Player LowGuid %u",player->GetGUIDLow());
    BuildReport(player,FLY_HACK_REPORT);
	std::string ircchana = sWorld->AntiCheatWarnChannel;
    std::stringstream ssa;
    ssa << player->GetName();
    ssa << " <- Lagging or fly hack!";
	if(sIRC.Active == 1)
		sIRC.Send_IRC_Channel(ircchana, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 AntiCheat \00304,08\037/!\\\037\017 %s", "%s", ssa.str().c_str()), true);
}
Beispiel #3
0
// basic detection
void AnticheatMgr::ClimbHackDetection(Player *player, MovementInfo movementInfo, uint32 opcode)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & CLIMB_HACK_DETECTION) == 0)
        return;

    uint32 key = player->GetGUIDLow();

    if (opcode != MSG_MOVE_HEARTBEAT ||
        m_Players[key].GetLastOpcode() != MSG_MOVE_HEARTBEAT)
        return;

    // in this case we don't care if they are "legal" flags, they are handled in another parts of the Anticheat Manager.
    if (player->IsInWater() ||
        player->IsFlying() ||
        player->IsFalling())
        return;

    Position playerPos;
    Position pos = player->GetPosition();

    float deltaZ = fabs(playerPos.GetPositionZ() - movementInfo.pos.GetPositionZ());
    float deltaXY = movementInfo.pos.GetExactDist2d(&playerPos);

    float angle = Position::NormalizeOrientation(tan(deltaZ/deltaXY));

    if (angle > CLIMB_ANGLE)
    {
        TC_LOG_DEBUG("entities.player.character", "AnticheatMgr:: Climb-Hack detected player GUID (low) %u", player->GetGUIDLow());
        BuildReport(player,CLIMB_HACK_REPORT);
    }
}
Beispiel #4
0
void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo movementInfo)
{
    if (!player->anticheatData.lastMovementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING))
        return;

    if (player->isGameMaster())
        return;
        
    // if we are a ghost we can walk on water
    if (!player->isAlive())
        return;
        
    if (
        player->HasAuraType(SPELL_AURA_FEATHER_FALL) || // as is says on tin
        player->HasAuraType(SPELL_AURA_SAFE_FALL) ||    // as is says on tin
        player->HasAuraType(SPELL_AURA_WATER_WALK) ||   // as is says on tin
        player->HasAura(3714) ||                        // path of frost
        player->HasAura(60068) ||                       // path of frost (2)
        player->HasAura(61081) ||                       // path of frost (3)
        player->HasAura(59307) ||                       // glyph path of frost
        player->HasAura(1706) ||                        // levitate
        player->HasAura(57987)                          // Glyph of Levitate
        )
        return;

    sLog->outError("Walk on Water Player LowGuid %u",player->GetGUIDLow());
    BuildReport(player,WALK_WATER_HACK_REPORT);

}
Beispiel #5
0
void AnticheatMgr::JumpHackDetection(Player* player, MovementInfo movementInfo,uint32 opcode)
{
    if (player->anticheatData.lastOpcode == MSG_MOVE_JUMP && opcode == MSG_MOVE_JUMP)
    {
        BuildReport(player,JUMP_HACK_REPORT);
        sLog->outError("Jump Hack Detection Player LowGuid %u",player->GetGUIDLow());
    }
}
Beispiel #6
0
void AnticheatMgr::SpeedHackDetection(Player* player,MovementInfo movementInfo)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & SPEED_HACK_DETECTION) == 0)
        return;

    if (player->GetMapId() == 607 || player->HasAura(35477) || player->HasAura(2983) || player->HasAura(1850) ||
        player->HasAuraType(SPELL_AURA_FEATHER_FALL) || player->HasAuraType(SPELL_AURA_SAFE_FALL) ||
        player->GetMapId() == 369 || player->GetMapId() == 582 || player->GetMapId() == 584 || player->GetMapId() == 586 ||
        player->GetMapId() == 587 || player->GetMapId() == 588 || player->GetMapId() == 589 || player->GetMapId() == 590 ||
        player->GetMapId() == 591 || player->GetMapId() == 592 || player->GetMapId() == 593 || player->GetMapId() == 594 ||
        player->GetMapId() == 596 || player->GetMapId() == 610 || player->GetMapId() == 612 || player->GetMapId() == 613 ||
        player->GetMapId() == 614 || player->GetMapId() == 620 || player->GetMapId() == 621 || player->GetMapId() == 622 ||
        player->GetMapId() == 623 || player->GetMapId() == 641 || player->GetMapId() == 642 || player->GetMapId() == 647 ||
        player->GetMapId() == 672 || player->GetMapId() == 673 || player->GetMapId() == 712 || player->GetMapId() == 713 ||
        player->GetMapId() == 718)
        return;

    uint32 key = player->GetGUIDLow();

    // We also must check the map because the movementFlag can be modified by the client.
    // If we just check the flag, they could always add that flag and always skip the speed hacking detection.
    // 369 == DEEPRUN TRAM
    if (m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && (player->GetMapId() == 369 || player->GetMapId() == 607))
        return;

    uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&m_Players[key].GetLastMovementInfo().pos);
    uint8 moveType = 0;

    // we need to know HOW is the player moving
    // TO-DO: Should we check the incoming movement flags?
    if (player->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING))
        moveType = MOVE_SWIM;
    else if (player->IsFlying())
        moveType = MOVE_FLIGHT;
    else if (player->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
        moveType = MOVE_WALK;
    else
        moveType = MOVE_RUN;

    // how many yards the player can do in one sec.
    uint32 speedRate = (uint32)(player->GetSpeed(UnitMoveType(moveType)) + movementInfo.j_xyspeed);

    // how long the player took to move to here.
    uint32 timeDiff = getMSTimeDiff(m_Players[key].GetLastMovementInfo().time,movementInfo.time);

    if (!timeDiff)
        timeDiff = 1;

    // this is the distance doable by the player in 1 sec, using the time done to move to this point.
    uint32 clientSpeedRate = distance2D * 1000 / timeDiff;

    // we did the (uint32) cast to accept a margin of tolerance
    if (clientSpeedRate > speedRate)
    {
        BuildReport(player,SPEED_HACK_REPORT);
        //sLog->outError("AnticheatMgr:: Speed-Hack detected player GUID (low) %u",player->GetGUIDLow());
    }
}
///////////////// Print PDF ///////////////////
void MediationProcess::PrintMediation()
{
    QPrinter printer(QPrinter::HighResolution);
    printer.setOutputFormat(QPrinter::PdfFormat);
    printer.setOutputFileName(DEF_PDF_PATH);

    BuildReport();

    _report->print(&printer);
}
void AnticheatMgr::JumpHackDetection(Player* player, MovementInfo /*movementInfo*/, uint32 opcode)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & JUMP_HACK_DETECTION) == 0)
        return;

    if (m_Players[player->GetGUIDLow()].GetLastOpcode() == MSG_MOVE_JUMP && opcode == MSG_MOVE_JUMP)
    {
        BuildReport(player, JUMP_HACK_REPORT);
        sLog->outError(LOG_FILTER_GENERAL, "AnticheatMgr:: Jump-Hack detected player GUID (low) %u", player->GetGUIDLow());
    }
}
Beispiel #9
0
void AnticheatMgr::JumpHackDetection(Player* player, MovementInfo /* movementInfo */,uint32 opcode)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & JUMP_HACK_DETECTION) == 0)
        return;

    uint32 key = player->GetGUIDLow();

    if (m_Players[key].GetLastOpcode() == MSG_MOVE_JUMP && opcode == MSG_MOVE_JUMP)
    {
        BuildReport(player,JUMP_HACK_REPORT);
        TC_LOG_DEBUG("entities.player.character", "AnticheatMgr:: Jump-Hack detected player GUID (low) %u",player->GetGUIDLow());
    }
}
Beispiel #10
0
void AnticheatMgr::SpeedHackDetection(Player* player,MovementInfo movementInfo)
{
    // Ignorar spell 56640
    if (player->HasAura(56640))
        return;
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & SPEED_HACK_DETECTION) == 0)
        return;

    uint32 key = player->GetGUIDLow();

    // We also must check the map because the movementFlag can be modified by the client.
    // If we just check the flag, they could always add that flag and always skip the speed hacking detection.
    // 369 == DEEPRUN TRAM && 607 == SoTA
    // if (m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && player->GetMapId() == 369 || player->GetMapId() == 607)
	// Para dejarlo como estaba borrar el de abajo y descomentar el anterior
	if (m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
        return;

    uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&m_Players[key].GetLastMovementInfo().pos);
    uint8 moveType = 0;

    // we need to know HOW is the player moving
    // TO-DO: Should we check the incoming movement flags?
    if (player->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING))
        moveType = MOVE_SWIM;
    else if (player->IsFlying())
        moveType = MOVE_FLIGHT;
    else if (player->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
        moveType = MOVE_WALK;
    else
        moveType = MOVE_RUN;

    // how many yards the player can do in one sec.
    uint32 speedRate = (uint32)(player->GetSpeed(UnitMoveType(moveType)) + movementInfo.j_xyspeed);
    
    // how long the player took to move to here.
    uint32 timeDiff = getMSTimeDiff(m_Players[key].GetLastMovementInfo().time,movementInfo.time);

    if (!timeDiff)
        timeDiff = 1;

    // this is the distance doable by the player in 1 sec, using the time done to move to this point.
    uint32 clientSpeedRate = distance2D * 1000 / timeDiff;

    // we did the (uint32) cast to accept a margin of tolerance
    if (clientSpeedRate > speedRate)
    {
        BuildReport(player,SPEED_HACK_REPORT);
        sLog->outError("AnticheatMgr:: Speed-Hack detected player GUID (low) %u",player->GetGUIDLow());
    }
}
void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo /*movementInfo*/)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & FLY_HACK_DETECTION) == 0)
        return;

    if (!m_Players[player->GetGUIDLow()].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FLYING))
        return;

    if (player->HasAuraType(SPELL_AURA_FLY) ||
        player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) ||
        player->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))
        return;

    sLog->outError(LOG_FILTER_GENERAL, "AnticheatMgr:: Fly-Hack detected player GUID (low) %u", player->GetGUIDLow());
    BuildReport(player, FLY_HACK_REPORT);
}
Beispiel #12
0
void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo /* movementInfo */)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & FLY_HACK_DETECTION) == 0)
        return;

    uint32 key = player->GetGUIDLow();
    if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FLYING))
        return;

    if (player->HasAuraType(SPELL_AURA_FLY) ||
        player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) ||
        player->HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))
        return;

    TC_LOG_DEBUG("entities.player.character", "AnticheatMgr:: Fly-Hack detected player GUID (low) %u",player->GetGUIDLow());
    BuildReport(player,FLY_HACK_REPORT);
}
Beispiel #13
0
void AnticheatMgr::TeleportPlaneHackDetection(Player* player, MovementInfo movementInfo)
{
    if (player->anticheatData.lastMovementInfo.pos.GetPositionZ() != 0 ||
        movementInfo.pos.GetPositionZ() != 0)
        return;

    if (movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING))
        return;

    if (player->getDeathState() == DEAD_FALLING)
        return;
    float x, y, z;
    player->GetPosition(x, y, z);
    float ground_Z = player->GetMap()->GetHeight(x, y, z);
    float z_diff = fabs(ground_Z - z);

    // we are not really walking there
    if (z_diff > 1.0f)
        BuildReport(player,TELEPORT_PLANE_HACK_REPORT);
}
void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo /*movementInfo*/)
{
    if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & WALK_WATER_HACK_DETECTION) == 0)
        return;

    if (!m_Players[player->GetGUIDLow()].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING))
        return;

    // if we are a ghost we can walk on water
    if (!player->isAlive())
        return;

    if (player->HasAuraType(SPELL_AURA_FEATHER_FALL) ||
        player->HasAuraType(SPELL_AURA_SAFE_FALL) ||
        player->HasAuraType(SPELL_AURA_WATER_WALK))
        return;

    sLog->outError(LOG_FILTER_GENERAL, "AnticheatMgr:: Walk on Water - Hack detected player GUID (low) %u", player->GetGUIDLow());
    BuildReport(player, WALK_WATER_HACK_REPORT);

}
Beispiel #15
0
void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo /* movementInfo */)
 {
	if ((sWorld->getIntConfig(CONFIG_ANTICHEAT_DETECTIONS_ENABLED) & WALK_WATER_HACK_DETECTION) == 0)
		 return;
	
		uint32 key = player->GetGUID().GetCounter();
	if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING))
		 return;
	
		    // if we are a ghost we can walk on water
		if (!player->IsAlive())
		 return;
	
		if (player->HasAuraType(SPELL_AURA_FEATHER_FALL) ||
		player->HasAuraType(SPELL_AURA_SAFE_FALL) ||
		player->HasAuraType(SPELL_AURA_WATER_WALK))
		 return;
	
		TC_LOG_DEBUG("entities.player.character", "AnticheatMgr:: Walk on Water - Hack detected player GUID (low) %u", player->GetGUID().GetCounter());
	BuildReport(player, WALK_WATER_HACK_REPORT);
	
		}
Beispiel #16
0
void AnticheatMgr::SpeedHackDetection(Player* player,MovementInfo movementInfo)
{
    // ghosts move faster
    if (!player->isAlive())
        return;
    if (player->isGameMaster())
        return;
   // if (player->IsMounted())
   //     return;
	if (player->HasUnitState(UNIT_STAT_ONVEHICLE))
	    return;
    if (player->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
        return;
	if (player->IsFalling() && player->GetMapId() == 607) //False segnalation in SOTA
        return;
     
    if (player->IsFalling())
        return;  
        
    if (player->HasAuraType(SPELL_AURA_FEATHER_FALL) || player->HasAuraType(SPELL_AURA_SAFE_FALL))
        return;
    
        
    uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&player->anticheatData.lastMovementInfo.pos);
    uint8 moveType = 0;
	float auraspeed = 0.0f;
	int32 main_speed_mod = 0;
    int32 main_speed_mod_fly = 0;
    float stack_bonus = 0.0f;
    float stack_bonus_fly = 0.0f;
    float non_stack_bonus = 0.0f;
    float main_speed_mod_swim = 0.0f;

    // we need to know HOW is the player moving
    // TO-DO: Should we check the incoming movement flags?
    if (player->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING))
        moveType = MOVE_SWIM;
    else if (player->IsFlying())
        moveType = MOVE_FLIGHT;
    else if (player->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
        moveType = MOVE_WALK;
    else
        moveType = MOVE_RUN;
    
    if (moveType == MOVE_SWIM)
    {
        // no need for mount check
		main_speed_mod_swim = player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_SWIM_SPEED);
		non_stack_bonus = (100.0f + player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_SPEED_NOT_STACK)) / 100.0f;
		auraspeed = main_speed_mod_swim + non_stack_bonus;
	}

    if (moveType == MOVE_RUN)
    {
        if (player->IsMounted())
        {
            main_speed_mod = player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED);
            stack_bonus = player->GetTotalAuraMultiplier(SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS);
            non_stack_bonus = (100.0f + player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK)) / 100.0f;
            auraspeed += main_speed_mod + stack_bonus + non_stack_bonus; 
        }
        else
        {
            main_speed_mod = player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_SPEED);
            stack_bonus = player->GetTotalAuraMultiplier(SPELL_AURA_MOD_SPEED_ALWAYS);
            non_stack_bonus = (100.0f + player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_SPEED_NOT_STACK)) / 100.0f;
            auraspeed += main_speed_mod + stack_bonus + non_stack_bonus;
        }
    }

    if (moveType == MOVE_FLIGHT)
    {
		// no need for mount check
		main_speed_mod_fly = player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED);
		stack_bonus_fly = player->GetTotalAuraMultiplier(SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS);
		non_stack_bonus = (100.0f + player->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_SPEED_NOT_STACK)) / 100.0f;
		auraspeed += main_speed_mod_fly + stack_bonus_fly + non_stack_bonus;
    }
 
    // how many yards the player can do in one sec.
    uint32 speedRate = (uint32)(player->GetSpeed(UnitMoveType(moveType)) + movementInfo.j_xyspeed + auraspeed);

    // how long the player took to move to here.
    uint32 timeDiff = getMSTimeDiff(player->anticheatData.lastMovementInfo.time,movementInfo.time);

    if (timeDiff == 0)
        timeDiff = 1;

    // this is the distance doable by the player in 1 sec, using the time done to move to this point.
	//this has changed since 335a was 1000
    uint32 clientSpeedRate = (distance2D * 1000 / timeDiff) + auraspeed;

    sLog->outError("fallxy %f fallz %f Distance2D %u clientSpeedRate %u speedRate %u auraspeed %u timeDiff %u ",movementInfo.j_xyspeed, movementInfo.j_zspeed,distance2D,clientSpeedRate,speedRate,auraspeed,timeDiff);
    
    // we did the (uint32) cast to accept a margin of tolerance
    if (clientSpeedRate > speedRate)
    {
        BuildReport(player,SPEED_HACK_REPORT);
        sLog->outError("Speed Hack Player LowGuid %u",player->GetGUIDLow());
		std::string ircchana = sWorld->AntiCheatWarnChannel;
        std::stringstream ssa;
        ssa << player->GetName();
        ssa << " <- Lagging or speed hack!";
		if(sIRC.Active == 1)
			sIRC.Send_IRC_Channel(ircchana, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 AntiCheat \00304,08\037/!\\\037\017 %s", "%s", ssa.str().c_str()), true);
    }
}