feat(Config): update to new API (#40)

This commit is contained in:
Kargatum
2021-11-03 16:43:38 +07:00
committed by GitHub
parent 5ae7d3dbc2
commit 0467ed0f51
3 changed files with 29 additions and 29 deletions

View File

@@ -23,7 +23,7 @@ public:
void OnLogin(Player* player) override
{
sAnticheatMgr->HandlePlayerLogin(player);
if(sConfigMgr->GetBoolDefault("Anticheat.LoginMessage", true))
if(sConfigMgr->GetOption<bool>("Anticheat.LoginMessage", true))
ChatHandler(player->GetSession()).PSendSysMessage("This server is running an Anticheat Module.");
}
};
@@ -45,7 +45,7 @@ public:
}
if (sWorld->GetUptime() > lastIterationPlayer)
{
lastIterationPlayer = sWorld->GetUptime() + sConfigMgr->GetIntDefault("Anticheat.SaveReportsTime", 60);
lastIterationPlayer = sWorld->GetUptime() + sConfigMgr->GetOption<uint32>("Anticheat.SaveReportsTime", 60);
sLog->outString( "Saving reports for %u players.", sWorld->GetPlayerCount());
for (SessionMap::const_iterator itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
@@ -71,7 +71,7 @@ class AnticheatMovementHandlerScript : public MovementHandlerScript
}
void OnPlayerMove(Player* player, MovementInfo mi, uint32 opcode) override
{
if (!AccountMgr::IsGMAccount(player->GetSession()->GetSecurity()) || sConfigMgr->GetBoolDefault("Anticheat.EnabledOnGmAccounts", false))
if (!AccountMgr::IsGMAccount(player->GetSession()->GetSecurity()) || sConfigMgr->GetOption<bool>("Anticheat.EnabledOnGmAccounts", false))
sAnticheatMgr->StartHackDetection(player, mi, opcode);
}
};