diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 70d5e1b019..2db6503248 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -58,7 +58,8 @@ LFGDungeonData::LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(d } LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1), - m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK)) + m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK)), + m_isSoloLFG(false) { } @@ -1060,7 +1061,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, ObjectGuid guid, bool accept) if (itPlayers->second.accept != LFG_ANSWER_AGREE) // No answer (-1) or not accepted (0) allAnswered = false; - if (!allAnswered) + if (!sLFGMgr->IsSoloLFG() && !allAnswered) { for (LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) SendLfgUpdateProposal(it->first, proposal); @@ -2143,4 +2144,9 @@ LfgDungeonSet LFGMgr::GetRandomAndSeasonalDungeons(uint8 level, uint8 expansion) return randomDungeons; } +void LFGMgr::ToggleSoloLFG() +{ + m_isSoloLFG = !m_isSoloLFG; +} + } // namespace lfg diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 3d9109677c..476b824727 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -408,6 +408,11 @@ class TC_GAME_API LFGMgr /// Leaves lfg void LeaveLfg(ObjectGuid guid, bool disconnected = false); + /// Toggle LFG in debug mode + void ToggleSoloLFG(); + /// Check if debug mode + bool IsSoloLFG() const { return m_isSoloLFG; } + // LfgQueue /// Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON) LfgState GetOldState(ObjectGuid guid); @@ -465,6 +470,8 @@ class TC_GAME_API LFGMgr uint32 m_lfgProposalId; /// used as internal counter for proposals uint32 m_options; /// Stores config options + bool m_isSoloLFG; /// solo lfg + LfgQueueContainer QueuesStore; /// Queues LfgCachedDungeonContainer CachedDungeonMapStore; /// Stores all dungeons by groupType // Reward System diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp index 1580206eac..c9274a6d84 100644 --- a/src/server/game/DungeonFinding/LFGQueue.cpp +++ b/src/server/game/DungeonFinding/LFGQueue.cpp @@ -422,7 +422,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check) } // Group with less that MAX_GROUP_SIZE members always compatible - if (check.size() == 1 && numPlayers != MAX_GROUP_SIZE) + if (!sLFGMgr->IsSoloLFG() && numPlayers != MAX_GROUP_SIZE) //solo lfg { TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: ({}) single group. Compatibles", GetDetailedMatchRoles(check)); LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(check.front()); @@ -520,7 +520,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check) } // Enough players? - if (numPlayers != MAX_GROUP_SIZE) + if (!sLFGMgr->IsSoloLFG() && numPlayers != MAX_GROUP_SIZE) //solo lfg { TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: ({}) Compatibles but not enough players({})", GetDetailedMatchRoles(check), numPlayers); LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS); diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index c01dbc967c..96b1375994 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -21,6 +21,7 @@ #include "LFGScripts.h" #include "Common.h" +#include "Config.h" #include "Group.h" #include "LFGMgr.h" #include "Log.h" @@ -52,6 +53,14 @@ void LFGPlayerScript::OnLogout(Player* player) void LFGPlayerScript::OnLogin(Player* player, bool /*loginFirst*/) { + if (sConfigMgr->GetIntDefault("SoloLFG.Enable", true)) + { + if (!sLFGMgr->IsSoloLFG()) + { + sLFGMgr->ToggleSoloLFG(); + } + } + if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER)) return; diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 90ad17d318..26e201eb9f 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -38,6 +38,7 @@ # PACKET SPOOF PROTECTION SETTINGS # MISC ANTI-CHEAT SETTINGS # METRIC SETTINGS +# SOLO LFG # ################################################################################################### @@ -4147,3 +4148,16 @@ Metric.OverallStatusInterval = 1 # ################################################################################################### + +################################################################################################### +# SOLO LFG +# +# SoloLFG.Enable +# Description: Enable the module. +# Default: 1 - (Enabled) +# 0 - (Disabled) + +SoloLFG.Enable = 1 + +# +###################################################################################################