feat(Core/Player): allow to queue both RDF & BGs together (#10102)

This commit is contained in:
IntelligentQuantum
2022-01-25 12:51:01 +03:30
committed by GitHub
parent 2fce4e0f12
commit a1c415b226
5 changed files with 34 additions and 8 deletions

View File

@@ -605,8 +605,11 @@ namespace lfg
if (!isRaid && joinData.result == LFG_JOIN_OK)
{
// Check player or group member restrictions
if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue())
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
{
if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue())
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
}
else if (player->HasAura(LFG_SPELL_DUNGEON_DESERTER))
joinData.result = LFG_JOIN_DESERTER;
else if (dungeons.empty())
@@ -623,9 +626,15 @@ namespace lfg
if (Player* plrg = itr->GetSource())
{
if (plrg->HasAura(LFG_SPELL_DUNGEON_DESERTER))
{
joinData.result = LFG_JOIN_PARTY_DESERTER;
else if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue())
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
}
else if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
{
if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue())
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
}
++memberCount;
players.insert(plrg->GetGUID());
}

View File

@@ -154,8 +154,11 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
{
if (GetPlayer()->InBattleground()) // currently in battleground
err = ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND;
else if (GetPlayer()->isUsingLfg()) // using lfg system
err = ERR_LFG_CANT_USE_BATTLEGROUND;
else if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
{
if (GetPlayer()->isUsingLfg()) // using lfg system
err = ERR_LFG_CANT_USE_BATTLEGROUND;
}
else if (!_player->CanJoinToBattleground()) // has deserter debuff
err = ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS;
else if (_player->InBattlegroundQueueForBattlegroundQueueType(bgQueueTypeIdRandom)) // queued for random bg, so can't queue for anything else
@@ -672,8 +675,11 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
{
if (GetPlayer()->InBattleground()) // currently in battleground
err = ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND;
else if (GetPlayer()->isUsingLfg()) // using lfg system
err = ERR_LFG_CANT_USE_BATTLEGROUND;
else if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
{
if (GetPlayer()->isUsingLfg()) // using lfg system
err = ERR_LFG_CANT_USE_BATTLEGROUND;
}
if (err <= 0)
{

View File

@@ -172,6 +172,7 @@ enum WorldBoolConfigs
CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE,
CONFIG_REALM_LOGIN_ENABLED,
CONFIG_PLAYER_SETTINGS_ENABLED,
CONFIG_ALLOW_JOIN_BG_AND_LFG,
BOOL_CONFIG_VALUE_COUNT
};

View File

@@ -1242,6 +1242,8 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_PLAYER_SETTINGS_ENABLED] = sConfigMgr->GetOption<bool>("EnablePlayerSettings", 0);
m_bool_configs[CONFIG_ALLOW_JOIN_BG_AND_LFG] = sConfigMgr->GetOption<bool>("JoinBGAndLFG.Enable", false);
///- Read the "Data" directory from the config file
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))

View File

@@ -3622,6 +3622,14 @@ LFG.KickPreventionTimer = 900
EnablePlayerSettings = 0
#
# JoinBGAndLFG.Enable
# Description: Allow queueing for BG and LFG at the same time.
# Default: 0 - Disabled
# 1 - Enabled
JoinBGAndLFG.Enable = 0
#
###################################################################################################