mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
refactore(core/config): Move BG Report AFK To Conf (#2813)
This commit is contained in:
committed by
GitHub
parent
a0b00be5b0
commit
ec806d6c60
@@ -22761,15 +22761,15 @@ void Player::ReportedAfkBy(Player* reporter)
|
||||
return;
|
||||
|
||||
// Xinef: 2 minutes startup + 2 minute of match
|
||||
if (bg->GetStartTime() < 4*MINUTE*IN_MILLISECONDS)
|
||||
if (bg->GetStartTime() < sWorld->getIntConfig(CONFIG_BATTLEGROUND_REPORT_AFK_TIMER) * MINUTE * IN_MILLISECONDS)
|
||||
return;
|
||||
|
||||
// check if player has 'Idle' or 'Inactive' debuff
|
||||
if (m_bgData.bgAfkReporter.find(reporter->GetGUIDLow()) == m_bgData.bgAfkReporter.end() && !HasAura(43680) && !HasAura(43681) && reporter->CanReportAfkDueToLimit())
|
||||
{
|
||||
m_bgData.bgAfkReporter.insert(reporter->GetGUIDLow());
|
||||
// 3 players have to complain to apply debuff
|
||||
if (m_bgData.bgAfkReporter.size() >= 3)
|
||||
// by default 3 players have to complain to apply debuff
|
||||
if (m_bgData.bgAfkReporter.size() >= sWorld->getIntConfig(CONFIG_BATTLEGROUND_REPORT_AFK))
|
||||
{
|
||||
// cast 'Idle' spell
|
||||
CastSpell(this, 43680, true);
|
||||
|
||||
@@ -1153,6 +1153,16 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfigMgr->GetIntDefault("Battleground.InvitationType", 0);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS);
|
||||
m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetBoolDefault("Battleground.GiveXPForKills", false);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK_TIMER] = sConfigMgr->GetIntDefault("Battleground.ReportAFK.Timer", 4);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = sConfigMgr->GetIntDefault("Battleground.ReportAFK", 3);
|
||||
if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] < 1) {
|
||||
sLog->outError("Battleground.ReportAFK (%d) must be >0. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3;
|
||||
} else if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] > 9) {
|
||||
sLog->outError("Battleground.ReportAFK (%d) must be <10. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3;
|
||||
}
|
||||
|
||||
m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfigMgr->GetIntDefault ("Arena.MaxRatingDifference", 150);
|
||||
m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfigMgr->GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS);
|
||||
m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfigMgr->GetBoolDefault("Arena.AutoDistributePoints", false);
|
||||
|
||||
@@ -294,6 +294,8 @@ enum WorldIntConfigs
|
||||
CONFIG_DISABLE_BREATHING,
|
||||
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
|
||||
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
|
||||
CONFIG_BATTLEGROUND_REPORT_AFK_TIMER,
|
||||
CONFIG_BATTLEGROUND_REPORT_AFK,
|
||||
CONFIG_BATTLEGROUND_INVITATION_TYPE,
|
||||
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
|
||||
CONFIG_ARENA_RATING_DISCARD_TIMER,
|
||||
|
||||
Reference in New Issue
Block a user