feat(Core/BattlegroundQueue): add limited Battleground.QueueAnnouncer (#5093)
This commit is contained in:
@@ -976,6 +976,7 @@ void BattlegroundQueue::SendMessageQueue(Player* leader, Battleground* bg, PvPDi
|
||||
uint32 q_max_level = std::min(bracketEntry->maxLevel, (uint32)80);
|
||||
uint32 qHorde = GetPlayersCountInGroupsQueue(bracketId, BG_QUEUE_NORMAL_HORDE);
|
||||
uint32 qAlliance = GetPlayersCountInGroupsQueue(bracketId, BG_QUEUE_NORMAL_ALLIANCE);
|
||||
uint32 leftPlayers = MaxPlayers - qHorde - qAlliance;
|
||||
|
||||
// Show queue status to player only (when joining battleground queue or Arena and arena world announcer is disabled)
|
||||
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY) || (bg->isArena() && !sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)))
|
||||
@@ -990,12 +991,17 @@ void BattlegroundQueue::SendMessageQueue(Player* leader, Battleground* bg, PvPDi
|
||||
if (searchGUID == BGSpamProtection.end())
|
||||
BGSpamProtection[leader->GetGUID()] = 0; // Leader GUID not found, initialize with 0
|
||||
|
||||
if (sWorld->GetGameTime() - BGSpamProtection[leader->GetGUID()] >= 30)
|
||||
{
|
||||
// Skip if spam time < 30 secs (default)
|
||||
if (sWorld->GetGameTime() - BGSpamProtection[leader->GetGUID()] < sWorld->getIntConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY))
|
||||
return;
|
||||
|
||||
// If left players > 1 - skip announce
|
||||
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMITED_ENABLE) && leftPlayers != 1)
|
||||
return;
|
||||
|
||||
BGSpamProtection[leader->GetGUID()] = sWorld->GetGameTime();
|
||||
sWorld->SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level, qAlliance + qHorde, MaxPlayers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
|
||||
@@ -105,6 +105,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG,
|
||||
CONFIG_BATTLEGROUND_CAST_DESERTER,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMITED_ENABLE,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY,
|
||||
CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE,
|
||||
CONFIG_BATTLEGROUND_TRACK_DESERTERS,
|
||||
@@ -282,6 +283,7 @@ enum WorldIntConfigs
|
||||
CONFIG_DEATH_SICKNESS_LEVEL,
|
||||
CONFIG_INSTANT_LOGOUT,
|
||||
CONFIG_DISABLE_BREATHING,
|
||||
CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY,
|
||||
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
|
||||
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
|
||||
CONFIG_BATTLEGROUND_REPORT_AFK_TIMER,
|
||||
|
||||
@@ -1119,6 +1119,8 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG] = sConfigMgr->GetOption<bool>("Battleground.DisableReadyCheckInBG", false);
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfigMgr->GetOption<bool>("Battleground.CastDeserter", true);
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption<bool>("Battleground.QueueAnnouncer.Enable", false);
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMITED_ENABLE] = sConfigMgr->GetOption<bool>("Battleground.QueueAnnouncer.Limited.Enable", false);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY] = sConfigMgr->GetOption<uint32>("Battleground.QueueAnnouncer.SpamProtection.Delay", 30);
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption<bool>("Battleground.QueueAnnouncer.PlayerOnly", false);
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE] = sConfigMgr->GetOption<bool>("Battleground.StoreStatistics.Enable", false);
|
||||
m_bool_configs[CONFIG_BATTLEGROUND_TRACK_DESERTERS] = sConfigMgr->GetOption<bool>("Battleground.TrackDeserters.Enable", false);
|
||||
|
||||
@@ -2752,6 +2752,22 @@ Battleground.CastDeserter = 1
|
||||
|
||||
Battleground.QueueAnnouncer.Enable = 0
|
||||
|
||||
#
|
||||
# Battleground.QueueAnnouncer.Limited.Enable
|
||||
# Description: Show announce only if left players in queue = 1
|
||||
# Default: 0 - (Disabled)
|
||||
# 1 - (Enabled)
|
||||
|
||||
Battleground.QueueAnnouncer.Limited.Enable = 0
|
||||
|
||||
#
|
||||
# Battleground.QueueAnnouncer.SpamProtection.Delay
|
||||
# Description: Show announce if player rejoined in queue after sec
|
||||
# Default: 30
|
||||
#
|
||||
|
||||
Battleground.QueueAnnouncer.SpamProtection.Delay = 30
|
||||
|
||||
#
|
||||
# Battleground.QueueAnnouncer.PlayerOnly
|
||||
# Description: Battleground queue announcement type.
|
||||
|
||||
Reference in New Issue
Block a user