feat(Core/Player): allow to queue both RDF & BGs together (#10102)
This commit is contained in:
committed by
GitHub
parent
2fce4e0f12
commit
a1c415b226
@@ -605,8 +605,11 @@ namespace lfg
|
|||||||
if (!isRaid && joinData.result == LFG_JOIN_OK)
|
if (!isRaid && joinData.result == LFG_JOIN_OK)
|
||||||
{
|
{
|
||||||
// Check player or group member restrictions
|
// Check player or group member restrictions
|
||||||
if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue())
|
if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
|
||||||
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
|
{
|
||||||
|
if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue())
|
||||||
|
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
|
||||||
|
}
|
||||||
else if (player->HasAura(LFG_SPELL_DUNGEON_DESERTER))
|
else if (player->HasAura(LFG_SPELL_DUNGEON_DESERTER))
|
||||||
joinData.result = LFG_JOIN_DESERTER;
|
joinData.result = LFG_JOIN_DESERTER;
|
||||||
else if (dungeons.empty())
|
else if (dungeons.empty())
|
||||||
@@ -623,9 +626,15 @@ namespace lfg
|
|||||||
if (Player* plrg = itr->GetSource())
|
if (Player* plrg = itr->GetSource())
|
||||||
{
|
{
|
||||||
if (plrg->HasAura(LFG_SPELL_DUNGEON_DESERTER))
|
if (plrg->HasAura(LFG_SPELL_DUNGEON_DESERTER))
|
||||||
|
{
|
||||||
joinData.result = LFG_JOIN_PARTY_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;
|
++memberCount;
|
||||||
players.insert(plrg->GetGUID());
|
players.insert(plrg->GetGUID());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,8 +154,11 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
|||||||
{
|
{
|
||||||
if (GetPlayer()->InBattleground()) // currently in battleground
|
if (GetPlayer()->InBattleground()) // currently in battleground
|
||||||
err = ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND;
|
err = ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND;
|
||||||
else if (GetPlayer()->isUsingLfg()) // using lfg system
|
else if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
|
||||||
err = ERR_LFG_CANT_USE_BATTLEGROUND;
|
{
|
||||||
|
if (GetPlayer()->isUsingLfg()) // using lfg system
|
||||||
|
err = ERR_LFG_CANT_USE_BATTLEGROUND;
|
||||||
|
}
|
||||||
else if (!_player->CanJoinToBattleground()) // has deserter debuff
|
else if (!_player->CanJoinToBattleground()) // has deserter debuff
|
||||||
err = ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS;
|
err = ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS;
|
||||||
else if (_player->InBattlegroundQueueForBattlegroundQueueType(bgQueueTypeIdRandom)) // queued for random bg, so can't queue for anything else
|
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
|
if (GetPlayer()->InBattleground()) // currently in battleground
|
||||||
err = ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND;
|
err = ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND;
|
||||||
else if (GetPlayer()->isUsingLfg()) // using lfg system
|
else if (!sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG))
|
||||||
err = ERR_LFG_CANT_USE_BATTLEGROUND;
|
{
|
||||||
|
if (GetPlayer()->isUsingLfg()) // using lfg system
|
||||||
|
err = ERR_LFG_CANT_USE_BATTLEGROUND;
|
||||||
|
}
|
||||||
|
|
||||||
if (err <= 0)
|
if (err <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ enum WorldBoolConfigs
|
|||||||
CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE,
|
CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE,
|
||||||
CONFIG_REALM_LOGIN_ENABLED,
|
CONFIG_REALM_LOGIN_ENABLED,
|
||||||
CONFIG_PLAYER_SETTINGS_ENABLED,
|
CONFIG_PLAYER_SETTINGS_ENABLED,
|
||||||
|
CONFIG_ALLOW_JOIN_BG_AND_LFG,
|
||||||
BOOL_CONFIG_VALUE_COUNT
|
BOOL_CONFIG_VALUE_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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_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
|
///- Read the "Data" directory from the config file
|
||||||
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
|
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
|
||||||
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
|
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
|
||||||
|
|||||||
@@ -3622,6 +3622,14 @@ LFG.KickPreventionTimer = 900
|
|||||||
|
|
||||||
EnablePlayerSettings = 0
|
EnablePlayerSettings = 0
|
||||||
|
|
||||||
|
#
|
||||||
|
# JoinBGAndLFG.Enable
|
||||||
|
# Description: Allow queueing for BG and LFG at the same time.
|
||||||
|
# Default: 0 - Disabled
|
||||||
|
# 1 - Enabled
|
||||||
|
|
||||||
|
JoinBGAndLFG.Enable = 0
|
||||||
|
|
||||||
#
|
#
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user