Solo lfg
This commit is contained in:
@@ -59,7 +59,8 @@ LFGDungeonData::LFGDungeonData(LFGDungeonsEntry const* dbc) : id(dbc->ID), name(
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1087,7 +1088,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);
|
||||
@@ -2511,4 +2512,9 @@ void LFGMgr::ConfirmExpandSearch(Player* player, WorldPackets::LFG::RideTicket c
|
||||
owner.ToString(), uint32(queued.size()), uint32(expanded.size()));
|
||||
}
|
||||
|
||||
void LFGMgr::ToggleSoloLFG()
|
||||
{
|
||||
m_isSoloLFG = !m_isSoloLFG;
|
||||
}
|
||||
|
||||
} // namespace lfg
|
||||
|
||||
@@ -434,6 +434,10 @@ class TC_GAME_API LFGMgr
|
||||
//WowCommunity
|
||||
/// CMSG_DF_CONFIRM_EXPAND_SEARCH: widen an already-queued entry's dungeon set without losing its place
|
||||
void ConfirmExpandSearch(Player* player, WorldPackets::LFG::RideTicket const& ticket);
|
||||
/// Toggle LFG in debug mode
|
||||
void ToggleSoloLFG();
|
||||
/// Check if debug mode
|
||||
bool IsSoloLFG() const { return m_isSoloLFG; }
|
||||
//WowCommunity
|
||||
/// Gets unique join queue data
|
||||
WorldPackets::LFG::RideTicket const* GetTicket(ObjectGuid guid) const;
|
||||
@@ -519,6 +523,7 @@ class TC_GAME_API LFGMgr
|
||||
LfgGroupDataContainer GroupsStore; /// Group data
|
||||
//WowCommunity
|
||||
GuidSet ExpandSearchPromptedStore; /// Queue owners already offered SMSG_LFG_EXPAND_SEARCH_PROMPT
|
||||
bool m_isSoloLFG; /// solo lfg
|
||||
//WowCommunity
|
||||
};
|
||||
|
||||
|
||||
@@ -367,6 +367,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
|
||||
LfgDungeonSet proposalDungeons;
|
||||
LfgGroupsMap proposalGroups;
|
||||
LfgRolesMap proposalRoles;
|
||||
bool forceMinPlayers = sWorld->getBoolConfig(CONFIG_LFG_FORCE_MINPLAYERS);
|
||||
|
||||
// Check for correct size
|
||||
if (check.size() > MAX_GROUP_SIZE || check.empty())
|
||||
@@ -447,7 +448,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
|
||||
|
||||
// Group with less that MAX_GROUP_SIZE members always compatible
|
||||
// For follower dungeons, allow solo play (minimum 1 player)
|
||||
if (numPlayers != MAX_GROUP_SIZE && !hasFollowerDungeon)
|
||||
if (!sLFGMgr->IsSoloLFG() && !forceMinPlayers && numPlayers != MAX_GROUP_SIZE && !hasFollowerDungeon)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: ({}) single group. Compatibles", GetDetailedMatchRoles(check));
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(check.front());
|
||||
@@ -559,7 +560,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
|
||||
}
|
||||
|
||||
// Enough players?
|
||||
if (numPlayers != MAX_GROUP_SIZE && !hasFollowerDungeon)
|
||||
if (!forceMinPlayers && !sLFGMgr->IsSoloLFG() && numPlayers != MAX_GROUP_SIZE && !hasFollowerDungeon)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: ({}) Compatibles but not enough players({})", GetDetailedMatchRoles(check), numPlayers);
|
||||
LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS);
|
||||
|
||||
@@ -664,6 +664,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{ .Name = "Quests.IgnoreAutoComplete"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_AUTO_COMPLETE },
|
||||
{ .Name = "DetectPosCollision"sv, .DefaultValue = true, .Index = CONFIG_DETECT_POS_COLLISION },
|
||||
{ .Name = "Channel.RestrictedLfg"sv, .DefaultValue = true, .Index = CONFIG_RESTRICTED_LFG_CHANNEL },
|
||||
{ .Name = "DungeonFinder.ForceMinplayers"sv, .DefaultValue = false, .Index = CONFIG_LFG_FORCE_MINPLAYERS },
|
||||
{ .Name = "ChatFakeMessagePreventing"sv, .DefaultValue = false, .Index = CONFIG_CHAT_FAKE_MESSAGE_PREVENTING },
|
||||
{ .Name = "Death.CorpseReclaimDelay.PvP"sv, .DefaultValue = true, .Index = CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP },
|
||||
{ .Name = "Death.CorpseReclaimDelay.PvE"sv, .DefaultValue = true, .Index = CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE },
|
||||
|
||||
@@ -204,6 +204,7 @@ enum WorldBoolConfigs : uint32
|
||||
CONFIG_WOW_TOKEN_MARKET_ENABLED,
|
||||
CONFIG_SHOP_ENTITLEMENTS_ENABLED,
|
||||
CONFIG_SHOP_ENTITLEMENT_ASSIGN_ENABLED,
|
||||
CONFIG_LFG_FORCE_MINPLAYERS,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* WOWCOMMUNITY
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Configuration/Config.h"
|
||||
#include "World.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
class lfg_solo_announce : public PlayerScript
|
||||
{
|
||||
public:
|
||||
lfg_solo_announce() : PlayerScript("lfg_solo_announce") {}
|
||||
|
||||
void OnLogin(Player* player, bool /*firstLogin*/) override
|
||||
{
|
||||
// Announce Module
|
||||
if (sConfigMgr->GetBoolDefault("SoloLFG.Announce", true))
|
||||
{
|
||||
ChatHandler(player->GetSession()).SendSysMessage("This server is running |cff4CFF00Solo Dungeon Finder|r.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class lfg_solo : public PlayerScript
|
||||
{
|
||||
public:
|
||||
lfg_solo() : PlayerScript("lfg_solo") { }
|
||||
|
||||
void OnLogin(Player* /*player*/, bool /*firstLogin*/) override
|
||||
{
|
||||
if (sConfigMgr->GetIntDefault("SoloLFG.Enable", true))
|
||||
{
|
||||
if (!sLFGMgr->IsSoloLFG())
|
||||
{
|
||||
sLFGMgr->ToggleSoloLFG();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void AddLfgSoloScripts()
|
||||
{
|
||||
new lfg_solo_announce();
|
||||
new lfg_solo();
|
||||
}
|
||||
@@ -37,6 +37,7 @@ void AddSC_custom_stormwind_player();
|
||||
void AddSC_custom_stormwind_quests();
|
||||
|
||||
void AddCustom_playerscript();
|
||||
void AddLfgSoloScripts();
|
||||
|
||||
void AddCustomScripts()
|
||||
{
|
||||
@@ -57,4 +58,5 @@ void AddCustomScripts()
|
||||
AddSC_custom_stormwind_quests();
|
||||
|
||||
AddCustom_playerscript();
|
||||
AddLfgSoloScripts();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user