diff --git a/CMakeLists.txt b/CMakeLists.txt index 59f556d..73f65be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,6 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Lfg_Solo.cpp") AC_ADD_SCRIPT_LOADER("Sc_Lfg_Solo" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h") -CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake") +AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/SoloLfg.conf.dist") message("-- Solo LFG CONFIGURED --") \ No newline at end of file diff --git a/conf/SoloLfg.conf.dist.txt b/conf/SoloLfg.conf.dist similarity index 75% rename from conf/SoloLfg.conf.dist.txt rename to conf/SoloLfg.conf.dist index f341cdb..5033877 100644 --- a/conf/SoloLfg.conf.dist.txt +++ b/conf/SoloLfg.conf.dist @@ -10,4 +10,7 @@ # 0 - (Disabled) -LFG.SoloMode = 1 \ No newline at end of file +LFG.SoloMode = 1 + + +################################################################################################### \ No newline at end of file diff --git a/lfg-solo.patch.txt b/lfg-solo.patch.txt new file mode 100644 index 0000000..e98f995 --- /dev/null +++ b/lfg-solo.patch.txt @@ -0,0 +1,91 @@ +From 9ab0fd18007be9f84d47e7d4cf9d821623fc868d Mon Sep 17 00:00:00 2001 +From: Micrah <44911744+milestorme@users.noreply.github.com> +Date: Sun, 1 Sep 2019 11:02:53 +1000 +Subject: [PATCH] add solo lfg + +--- + src/server/game/DungeonFinding/LFGMgr.cpp | 8 ++++++-- + src/server/game/DungeonFinding/LFGMgr.h | 6 +++++- + src/server/game/DungeonFinding/LFGQueue.cpp | 4 ++-- + src/server/game/DungeonFinding/LFGScripts.cpp | 9 +++++++++ + src/server/worldserver/worldserver.conf.dist | 7 +++++++ + 5 files changed, 29 insertions(+), 5 deletions(-) + +diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp +index 7fc218ee45..882d3488c6 100644 +--- a/src/server/game/DungeonFinding/LFGMgr.cpp ++++ b/src/server/game/DungeonFinding/LFGMgr.cpp +@@ -27,7 +27,7 @@ + namespace lfg + { + +-LFGMgr::LFGMgr(): m_lfgProposalId(1), m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK)) ++LFGMgr::LFGMgr(): m_lfgProposalId(1), m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK)), m_isSoloLFG(false) + { + new LFGPlayerScript(); + new LFGGroupScript(); +@@ -1622,7 +1622,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 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); +@@ -2703,5 +2703,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 c51f006600..5088701b15 100644 +--- a/src/server/game/DungeonFinding/LFGMgr.h ++++ b/src/server/game/DungeonFinding/LFGMgr.h +@@ -516,6 +516,10 @@ class LFGMgr + void RBPacketAppendPlayer(const RBInternalInfo& info, ByteBuffer& buffer); + void RBPacketBuildDifference(WorldPacket& differencePacket, uint32 dungeonId, uint32 deletedCounter, ByteBuffer& buffer_deleted, uint32 groupCounter, ByteBuffer& buffer_groups, uint32 playerCounter, ByteBuffer& buffer_players); + void RBPacketBuildFull(WorldPacket& fullPacket, uint32 dungeonId, RBInternalInfoMap& infoMap); ++ /// 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) +@@ -574,7 +578,7 @@ class LFGMgr + uint32 lastProposalId; ///< pussywizard, store it here because of splitting LFGMgr update into tasks + uint32 m_raidBrowserUpdateTimer[2]; ///< pussywizard + uint32 m_raidBrowserLastUpdatedDungeonId[2]; ///< pussywizard: for 2 factions +- ++ bool m_isSoloLFG; + 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 30ae2a4ec4..d6f6e43ccb 100644 +--- a/src/server/game/DungeonFinding/LFGQueue.cpp ++++ b/src/server/game/DungeonFinding/LFGQueue.cpp +@@ -289,7 +289,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const + return LFG_INCOMPATIBLES_MULTIPLE_LFG_GROUPS; + + // Group with less that MAXGROUPSIZE members always compatible +- if (check.size() == 1 && numPlayers < MAXGROUPSIZE) ++ if (!sLFGMgr->IsSoloLFG() && numPlayers != MAXGROUPSIZE) + { + LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(check.front()); + LfgRolesMap roles = itQueue->second.roles; +@@ -386,7 +386,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const + } + + // Enough players? +- if (numPlayers != MAXGROUPSIZE) ++ if (!sLFGMgr->IsSoloLFG() && numPlayers != MAXGROUPSIZE) + { + strGuids.addRoles(proposalRoles); + for (uint8 i=0; i<5 && check.guid[i]; ++i) \ No newline at end of file diff --git a/src/cmake/after_ws_install.cmake b/src/cmake/after_ws_install.cmake deleted file mode 100644 index efe345d..0000000 --- a/src/cmake/after_ws_install.cmake +++ /dev/null @@ -1,15 +0,0 @@ -if( WIN32 ) - if ( MSVC ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_DUELRESET_DIR}/conf/SoloLfg.conf.dist" ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ - ) - elseif ( MINGW ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_DUELRESET_DIR}/conf/SoloLfg.conf.dist" ${CMAKE_BINARY_DIR}/bin/ - ) - endif() -endif() - -install(FILES "${CMAKE_LFG_SOLO_DIR}/conf/SoloLfg.conf.dist" DESTINATION ${CONF_DIR})