本文整理汇总了C++中BuildReport函数的典型用法代码示例。如果您正苦于以下问题:C++ BuildReport函数的具体用法?C++ BuildReport怎么用?C++ BuildReport使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BuildReport函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fabs
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);
}
}
示例2: if
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());
}
}
示例3: printer
///////////////// Print PDF ///////////////////
void MediationProcess::PrintMediation()
{
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(DEF_PDF_PATH);
BuildReport();
_report->print(&printer);
}
示例4: BuildReport
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());
}
}
示例5: BuildReport
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());
}
}
示例6: if
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());
}
}
示例7: GUID
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);
}
示例8: TC_LOG_DEBUG
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);
}
示例9: TC_LOG_DEBUG
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);
}