Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (passive_anticheat): clean up and build fix #134

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sql/character.anticheat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ALTER TABLE `daily_players_reports`
ADD COLUMN `no_fall_damage_reports` BIGINT UNSIGNED NOT NULL DEFAULT 0 AFTER `antiknockback_reports`;
ADD COLUMN `op_ack_hack_reports` BIGINT UNSIGNED NOT NULL DEFAULT 0 AFTER `no_fall_damage_reports`;
ADD COLUMN `counter_measures_reports` BIGINT UNSIGNED NOT NULL DEFAULT 0 AFTER `op_ack_hack_reports`;

ALTER TABLE `players_reports_status`
ADD COLUMN `teleport_reports` BIGINT UNSIGNED NOT NULL DEFAULT 0 AFTER `climb_reports`,
ADD COLUMN `ignorecontrol_reports` BIGINT UNSIGNED NOT NULL DEFAULT 0 AFTER `teleport_reports`,
Expand Down
30 changes: 15 additions & 15 deletions src/server/game/Anticheat/AnticheatMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 TIME MANIPULATION COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
timeDiff = 1;
BuildReport(player, COUNTER_MEASURES_REPORT);
Expand All @@ -335,7 +335,7 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 TIME MANIPULATION COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
timeDiff = 1;
BuildReport(player, COUNTER_MEASURES_REPORT);
Expand Down Expand Up @@ -386,7 +386,7 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo)
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 SPEED HACK COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
BuildReport(player, COUNTER_MEASURES_REPORT);
}
Expand Down Expand Up @@ -452,7 +452,7 @@ void AnticheatMgr::FlyHackDetection(Player* player, MovementInfo movementInfo)
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 FLY HACK COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_WRITELOG))
{
Expand Down Expand Up @@ -517,7 +517,7 @@ void AnticheatMgr::JumpHackDetection(Player* player, MovementInfo movementInfo,
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 JUMP HACK COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
BuildReport(player, COUNTER_MEASURES_REPORT);
}
Expand Down Expand Up @@ -602,7 +602,7 @@ void AnticheatMgr::JumpHackDetection(Player* player, MovementInfo movementInfo,
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 ADVANCE JUMP HACK COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
BuildReport(player, COUNTER_MEASURES_REPORT);
}
Expand Down Expand Up @@ -768,7 +768,7 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
uint32 latency2 = 0;
latency2 = opponent->GetSession()->GetLatency();
std::string goXYZ2 = ".go xyz " + std::to_string(opponent->GetPositionX()) + " " + std::to_string(opponent->GetPositionY()) + " " + std::to_string(opponent->GetPositionZ() + 1.0f) + " " + std::to_string(opponent->GetMap()->GetId()) + " " + std::to_string(opponent->GetOrientation());
sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName(), latency, opponent->GetName(), latency2);
sWorld->SendGMText(LANG_ANTICHEAT_DUEL, player->GetName().c_str(), latency, opponent->GetName().c_str(), latency2);

if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_WRITELOG_ENABLE))
{
Expand Down Expand Up @@ -802,7 +802,7 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MIN) && m_Players[key].GetTotalReports() <= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MAX))
{
sWorld->SendGMText(LANG_ANTICHEAT_TELEPORT, player->GetName(), latency);
sWorld->SendGMText(LANG_ANTICHEAT_TELEPORT, player->GetName().c_str(), latency);
}
_counter = 0;
}
Expand Down Expand Up @@ -831,7 +831,7 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 TELEPORT COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
player->TeleportTo(player->GetMapId(), lastX, lastY, lastZ, player->GetOrientation());
BuildReport(player, COUNTER_MEASURES_REPORT);
Expand Down Expand Up @@ -891,7 +891,7 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MIN) && m_Players[key].GetTotalReports() <= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MAX))
{
sWorld->SendGMText(LANG_ANTICHEAT_IGNORECONTROL, player->GetName(), latency);
sWorld->SendGMText(LANG_ANTICHEAT_IGNORECONTROL, player->GetName().c_str(), latency);
}
_counter = 0;
}
Expand Down Expand Up @@ -1052,7 +1052,7 @@ void AnticheatMgr::ZAxisHackDetection(Player* player, MovementInfo movementInfo)
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MIN) && m_Players[key].GetTotalReports() <= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MAX))
{
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName(), player->GetName(), latency);
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
Expand Down Expand Up @@ -1088,7 +1088,7 @@ void AnticheatMgr::ZAxisHackDetection(Player* player, MovementInfo movementInfo)
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 IGNORE-Z HACK COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
BuildReport(player, COUNTER_MEASURES_REPORT);
}
Expand Down Expand Up @@ -1258,7 +1258,7 @@ void AnticheatMgr::BGreport(Player* player)
// need better way to limit chat spam
if (m_Players[key].GetTotalReports() >= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MIN) && m_Players[key].GetTotalReports() <= sWorld->getIntConfig(CONFIG_ANTICHEAT_REPORT_IN_CHAT_MAX))
{
sWorld->SendGMText(LANG_ANTICHEAT_BG_EXPLOIT, player->GetName(), player->GetName(), latency);
sWorld->SendGMText(LANG_ANTICHEAT_BG_EXPLOIT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
Expand Down Expand Up @@ -1301,7 +1301,7 @@ void AnticheatMgr::CheckBGOriginPositions(Player* player)
if (sWorld->getBoolConfig(CONFIG_ANTICHEAT_CM_ALERTCHAT))
{
std::string str = "|cFFFFFC00 BG START SPOT COUNTER MEASURE ALERT";
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str, player->GetName(), player->GetName());
sWorld->SendGMText(LANG_ANTICHEAT_COUNTERMEASURE, str.c_str(), player->GetName().c_str(), player->GetName().c_str());
}
player->TeleportTo(player->GetMapId(), startPos->GetPositionX(), startPos->GetPositionY(), startPos->GetPositionZ(), startPos->GetOrientation());
}
Expand Down Expand Up @@ -1685,7 +1685,7 @@ void AnticheatMgr::BuildReport(Player* player, uint8 reportType)
{
uint32 latency = 0;
latency = player->GetSession()->GetLatency();
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName(), player->GetName(), latency);
sWorld->SendGMText(LANG_ANTICHEAT_ALERT, player->GetName().c_str(), player->GetName().c_str(), latency);
}
_counter = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/worldserver/worldserver.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3404,7 +3404,7 @@ Anticheat.StricterFlyHackCheck = 0
Anticheat.StricterDetectJumpHack = 0

# Anticheat.SpeedLimitTolerance
# Description: Speed Limit Tolerance allows a certain whole percentage of tolerance to speed
# Description: Speed Limit Tolerance allows a certain whole percentage of tolerance to speed
# hack logging and detection.
#
# Example: AnticheatMgr:: Speed-Hack (Speed Movement at 12% above allowed Server Set rate 8%.)
Expand Down
Loading