refactore(core/config): Move BG Report AFK To Conf (#2813)

This commit is contained in:
IntelligentQuantum
2020-07-10 22:36:12 +04:30
committed by GitHub
parent a0b00be5b0
commit ec806d6c60
4 changed files with 32 additions and 5 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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,

View File

@@ -27,6 +27,7 @@
# CHARACTER DELETE OPTIONS
# ITEM DELETE OPTIONS
# CUSTOM SERVER OPTIONS
# PACKET SPOOF PROTECTION SETTINGS
# DEBUG
#
###################################################################################################
@@ -2764,6 +2765,20 @@ Battleground.TrackDeserters.Enable = 1
Battleground.InvitationType = 0
#
# Battleground.ReportAFK.Timer
# Description: After a few minutes that battle started you can report the player.
# Default: 4
Battleground.ReportAFK.Timer = 4
#
# Battleground.ReportAFK
# Description: Number of reports needed to kick someone AFK from Battleground.
# Range: 1-9
# Default: 3
Battleground.ReportAFK = 3
# Battleground.DisableQuestShareInBG
# Description: Disables the ability to share quests while in a Battleground.
# Default: 0 - (Disabled)
@@ -3516,13 +3531,13 @@ ICC.Buff.Alliance = 73828
###################################################################################################
###################################################################################################
# Packet Spoof Protection Settings
# PACKET SPOOF PROTECTION SETTINGS
#
# These settings determine which action to take when harmful packet spoofing is detected.
#
# PacketSpoof.Policy
# Description: Determines the course of action when packet spoofing is detected.
# Values: 0 - Log only
# Values: 0 - Log only
# 1 - Log + kick
# 2 - Log + kick + ban