mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 09:07:22 +00:00
Feat (AutoMod\Jail) and fixes in conf typo
Automatic Moderation feature: Auto Jail. It auto sends the offender to gm jail room, sets their homebind to the jail and freezes them as a precaution for them "jail breaking out" .unfreeze to undo the freeze. tele them out if innocent, or do whatever to your captive.
This commit is contained in:
@@ -598,6 +598,38 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType)
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.JailPlayer", true) && m_Players[key].GetTotalReports() > sConfigMgr->GetOption<uint32>("Anticheat.ReportsForJail", 70))
|
||||
{
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||
{
|
||||
LOG_INFO("module", "AnticheatMgr:: Reports reached assigned threshhold and counteracted by jailing player {} ({})", player->GetName(), player->GetGUID().ToString());
|
||||
}
|
||||
// display warning at the center of the screen, hacky way?
|
||||
std::string str = "";
|
||||
str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Jailed Account for Reaching Cheat Threshhold!";
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
|
||||
data << str;
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
|
||||
WorldLocation loc;
|
||||
loc = WorldLocation(1, 16226.5f, 16403.6f, -64.5f, 3.2f);// GM Jail Location
|
||||
player->TeleportTo(loc);
|
||||
player->SetHomebind(loc, 876);// GM Jail Homebind location
|
||||
player->CastSpell(player,9454);// freeze him in place to ensure no exploit happens for jail break attempt
|
||||
|
||||
if (sConfigMgr->GetOption<bool>("Anticheat.AnnounceJail", 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 Jailed by the Anticheat Module.|r";
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, stream.str().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AnticheatMgr::AnticheatGlobalCommand(ChatHandler* handler)
|
||||
|
||||
Reference in New Issue
Block a user