From 56e1b9aed77eb5b702b5f4c5ebd502bbd994d59d Mon Sep 17 00:00:00 2001 From: Exitare Date: Wed, 18 Dec 2024 19:53:11 -0800 Subject: [PATCH 01/13] Add config to prevent lfg teleportation --- .../apps/worldserver/worldserver.conf.dist | 8 ++++++++ src/server/game/DungeonFinding/LFGMgr.cpp | 18 ++++++++++++++++++ src/server/game/World/IWorld.h | 1 + 3 files changed, 27 insertions(+) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index f3754ca07e259f..aac37cbcef8be4 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -3278,6 +3278,14 @@ LFG.MaxKickCount = 2 LFG.KickPreventionTimer = 900 +# +# LFG.Teleport +# Description: Specify whether player are teleported to the dungeon after forming a group +# Default: 1 (default) +# 0 - Disabled (Players are not teleported but have to walk to dungeon) + +LFG.Teleport = 1 + # # DungeonAccessRequirements.LFGLevelDBCOverride # diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 672bf265f4568b..9f895075efef87 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1724,6 +1724,11 @@ namespace lfg bool randomDungeon = false; std::vector playersTeleported; + + // clear list of players to be teleported if config option is disabled + if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) + playersToTeleport.clear(); + // Teleport Player for (GuidUnorderedSet::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) { @@ -2150,6 +2155,13 @@ namespace lfg } else if (out && error == LFG_TELEPORTERROR_OK) { + // No dungon teleport allowed + if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) + { + ChatHandler(nullptr).PSendSysMessage("Teleportation to dungeons is deactivated."); + return; + } + if (player->GetMapId() == uint32(dungeon->map)) player->TeleportToEntryPoint(); @@ -2157,6 +2169,12 @@ namespace lfg } else { + // No dungon teleport allowed + if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { + ChatHandler(player->GetSession()).PSendSysMessage("Teleportation to dungeons is deactivated."); + return; + } + uint32 mapid = dungeon->map; float x = dungeon->x; float y = dungeon->y; diff --git a/src/server/game/World/IWorld.h b/src/server/game/World/IWorld.h index 6bae57661750f7..703fafb8f67114 100644 --- a/src/server/game/World/IWorld.h +++ b/src/server/game/World/IWorld.h @@ -184,6 +184,7 @@ enum WorldBoolConfigs CONFIG_MUNCHING_BLIZZLIKE, CONFIG_ENABLE_DAZE, CONFIG_SPELL_QUEUE_ENABLED, + CONFIG_LFG_TELEPORT, BOOL_CONFIG_VALUE_COUNT }; From 438f2480ff045eacf773fe7144123ea4db16002b Mon Sep 17 00:00:00 2001 From: Exitare Date: Wed, 18 Dec 2024 21:57:54 -0800 Subject: [PATCH 02/13] Add messages for the player(s) to know which dungeon was randomly selected. --- src/server/game/DungeonFinding/LFGMgr.cpp | 39 +++++++++++++++++++++-- src/server/game/DungeonFinding/LFGMgr.h | 2 ++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 9f895075efef87..e68f6023678e69 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1727,7 +1727,12 @@ namespace lfg // clear list of players to be teleported if config option is disabled if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) + { + // Send message to all players in newly formed group + SendMessageToAllPlayers(playersToTeleport, proposal); + // clearn the player list playersToTeleport.clear(); + } // Teleport Player for (GuidUnorderedSet::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) @@ -2158,7 +2163,9 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - ChatHandler(nullptr).PSendSysMessage("Teleportation to dungeons is deactivated."); + std::ostringstream ss; + ss << "Please move to the Dungeon: " << dungeon->name; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); return; } @@ -2170,8 +2177,11 @@ namespace lfg else { // No dungon teleport allowed - if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - ChatHandler(player->GetSession()).PSendSysMessage("Teleportation to dungeons is deactivated."); + if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) + { + std::ostringstream ss; + ss << "Please move to the Dungeon: " << dungeon->name; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); return; } @@ -2509,6 +2519,29 @@ namespace lfg GroupsStore[guid].SetDungeon(dungeon); } + void LFGMgr::SendMessageToAllPlayers(GuidUnorderedSet players, LfgProposal const& proposal) + { + // Send a message to the players + for (GuidUnorderedSet::const_iterator it = players.begin(); it != players.end(); ++it) + { + if (Player* player = ObjectAccessor::FindPlayer(*it)) + { + LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(proposal.dungeonId); + if (dungeon) { + std::ostringstream ss; + ss << "Please move to the Dungeon: " << dungeon->Name[0]; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); + + } + else { + std::ostringstream ss; + ss << "No Dungeon name found. You are on your own."; + ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); + } + } + } + } + void LFGMgr::SetRoles(ObjectGuid guid, uint8 roles) { LOG_DEBUG("lfg", "LFGMgr::SetRoles: [{}] roles: {}", guid.ToString(), roles); diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 0eb27e71c03a08..5dad814bddee22 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -579,6 +579,8 @@ namespace lfg [[nodiscard]] bool IsTesting() const { return m_Testing; } void SetDungeon(ObjectGuid guid, uint32 dungeon); + // Sends a message to all players in a set + void SendMessageToAllPlayers(GuidUnorderedSet players, LfgProposal const& proposal); private: TeamId GetTeam(ObjectGuid guid); From 34363f2ef0483e8471c62cec0202ffa9eee4baa2 Mon Sep 17 00:00:00 2001 From: Exitare Date: Wed, 18 Dec 2024 22:05:17 -0800 Subject: [PATCH 03/13] Remove trailing whitespace --- src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e68f6023678e69..1dbaaffaded502 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -2184,7 +2184,7 @@ namespace lfg ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); return; } - + uint32 mapid = dungeon->map; float x = dungeon->x; float y = dungeon->y; From 94298c86f94390164581c1a328f05a5858ee5b15 Mon Sep 17 00:00:00 2001 From: Exitare Date: Thu, 19 Dec 2024 17:25:17 -0800 Subject: [PATCH 04/13] Adress code review --- .../rev_1734657034946976800.sql | 5 ++++ src/server/game/DungeonFinding/LFGMgr.cpp | 26 ++++++++----------- src/server/game/Miscellaneous/Language.h | 5 +++- src/server/game/World/World.cpp | 2 ++ 4 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1734657034946976800.sql diff --git a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql new file mode 100644 index 00000000000000..563428de4e192f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `acore_string` where `entry` in (35410, 35411); +INSERT INTO `acore_string` (`entry`, `content_default`) VALUES +('35410', 'Please move to the Dungeon: {}.'), +('35411', 'No dungeon name found!'); diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 1dbaaffaded502..d1a386b7227e26 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -2163,9 +2163,8 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - std::ostringstream ss; - ss << "Please move to the Dungeon: " << dungeon->name; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); + ChatHandler handler = ChatHandler(player->GetSession()); + handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->name.c_str()); return; } @@ -2179,9 +2178,8 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - std::ostringstream ss; - ss << "Please move to the Dungeon: " << dungeon->name; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); + ChatHandler handler = ChatHandler(player->GetSession()); + handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->name.c_str()); return; } @@ -2526,17 +2524,15 @@ namespace lfg { if (Player* player = ObjectAccessor::FindPlayer(*it)) { + ChatHandler handler = ChatHandler(player->GetSession()); LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(proposal.dungeonId); - if (dungeon) { - std::ostringstream ss; - ss << "Please move to the Dungeon: " << dungeon->Name[0]; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); - + if (dungeon) + { + handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->Name[0]); } - else { - std::ostringstream ss; - ss << "No Dungeon name found. You are on your own."; - ChatHandler(player->GetSession()).PSendSysMessage(ss.str()); + else + { + handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_NO_DUNGEON)); } } } diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index d0219e83bc1c58..fc079b7cb0ce5d 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1329,6 +1329,9 @@ enum AcoreStrings // 30087-30095 reserved for passive anticheat LANG_DEBUG_LFG_ON = 30096, - LANG_DEBUG_LFG_OFF = 30097 + LANG_DEBUG_LFG_OFF = 30097, + LANG_LFG_TELEPORT_DUNGEON = 35410, // Dungeon found + LANG_LFG_TELEPORT_NO_DUNGEON = 35411 // No Dungeon found + }; #endif diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 01aebe6187e2cb..a28098c11f1ae8 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1271,6 +1271,8 @@ void World::LoadConfigSettings(bool reload) _bool_configs[CONFIG_ALLOW_JOIN_BG_AND_LFG] = sConfigMgr->GetOption("JoinBGAndLFG.Enable", false); + _bool_configs[CONFIG_LFG_TELEPORT] = sConfigMgr->GetOption("LFG.Teleport", 1); + _bool_configs[CONFIG_LEAVE_GROUP_ON_LOGOUT] = sConfigMgr->GetOption("LeaveGroupOnLogout.Enabled", false); _bool_configs[CONFIG_QUEST_POI_ENABLED] = sConfigMgr->GetOption("QuestPOI.Enabled", true); From 2a7c42fe05257c16a3c8ef1d326a3aa912363499 Mon Sep 17 00:00:00 2001 From: Exitare Date: Thu, 19 Dec 2024 17:26:40 -0800 Subject: [PATCH 05/13] Update worldserver.conf.dist --- src/server/apps/worldserver/worldserver.conf.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index aac37cbcef8be4..7e7a9e0e74c5cc 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -3281,7 +3281,7 @@ LFG.KickPreventionTimer = 900 # # LFG.Teleport # Description: Specify whether player are teleported to the dungeon after forming a group -# Default: 1 (default) +# Default: 1 - Enabled # 0 - Disabled (Players are not teleported but have to walk to dungeon) LFG.Teleport = 1 From 407009a55b96019aa0f6fe217cd9b60515d5fd6b Mon Sep 17 00:00:00 2001 From: Exitare Date: Fri, 20 Dec 2024 17:45:38 -0800 Subject: [PATCH 06/13] Core review --- src/server/game/DungeonFinding/LFGMgr.cpp | 5 +---- src/server/game/World/World.cpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index d1a386b7227e26..7cb40922bfa087 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -2527,13 +2527,10 @@ namespace lfg ChatHandler handler = ChatHandler(player->GetSession()); LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(proposal.dungeonId); if (dungeon) - { handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->Name[0]); - } else - { handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_NO_DUNGEON)); - } + } } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index a28098c11f1ae8..ce47be6ea9056e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1271,7 +1271,7 @@ void World::LoadConfigSettings(bool reload) _bool_configs[CONFIG_ALLOW_JOIN_BG_AND_LFG] = sConfigMgr->GetOption("JoinBGAndLFG.Enable", false); - _bool_configs[CONFIG_LFG_TELEPORT] = sConfigMgr->GetOption("LFG.Teleport", 1); + _bool_configs[CONFIG_LFG_TELEPORT] = sConfigMgr->GetOption("LFG.Teleport", true); _bool_configs[CONFIG_LEAVE_GROUP_ON_LOGOUT] = sConfigMgr->GetOption("LeaveGroupOnLogout.Enabled", false); From fa4529a24baa55f20cdf3ff81922440c9907c9e0 Mon Sep 17 00:00:00 2001 From: Exitare Date: Sat, 21 Dec 2024 13:37:30 -0800 Subject: [PATCH 07/13] Core review --- .../sql/updates/pending_db_world/rev_1734657034946976800.sql | 4 ++-- src/server/game/DungeonFinding/LFGMgr.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql index 563428de4e192f..3ba7a6e948291e 100644 --- a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql +++ b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql @@ -1,5 +1,5 @@ -- DELETE FROM `acore_string` where `entry` in (35410, 35411); INSERT INTO `acore_string` (`entry`, `content_default`) VALUES -('35410', 'Please move to the Dungeon: {}.'), -('35411', 'No dungeon name found!'); +(35410, 'Please move to the Dungeon: {}.'), +(35411, 'No dungeon name found!'); diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 7cb40922bfa087..9cdd311bfc27b9 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -2527,10 +2527,9 @@ namespace lfg ChatHandler handler = ChatHandler(player->GetSession()); LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(proposal.dungeonId); if (dungeon) - handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->Name[0]); + handler.PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->Name[0]); else - handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_NO_DUNGEON)); - + handler.PSendSysMessage(LANG_LFG_TELEPORT_NO_DUNGEON); } } } From 43770aa1c79dfdfd178dc8bd72e24b10f6d1a324 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 21 Dec 2024 22:58:12 +0100 Subject: [PATCH 08/13] Update data/sql/updates/pending_db_world/rev_1734657034946976800.sql --- data/sql/updates/pending_db_world/rev_1734657034946976800.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql index 3ba7a6e948291e..1e296062d2d79a 100644 --- a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql +++ b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql @@ -1,5 +1,5 @@ -- -DELETE FROM `acore_string` where `entry` in (35410, 35411); +DELETE FROM `acore_string` WHERE `entry` IN (35410, 35411); INSERT INTO `acore_string` (`entry`, `content_default`) VALUES (35410, 'Please move to the Dungeon: {}.'), (35411, 'No dungeon name found!'); From 5d234e554c982324160aa50e5f851ce3ff7be8d8 Mon Sep 17 00:00:00 2001 From: Exitare Date: Sat, 21 Dec 2024 14:01:19 -0800 Subject: [PATCH 09/13] Address code review --- .../updates/pending_db_world/rev_1734657034946976800.sql | 2 +- src/server/game/DungeonFinding/LFGMgr.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql index 3ba7a6e948291e..ae68c7920d3a8e 100644 --- a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql +++ b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql @@ -1,5 +1,5 @@ -- -DELETE FROM `acore_string` where `entry` in (35410, 35411); +DELETE FROM `acore_string` WHERE `entry` in (35410, 35411); INSERT INTO `acore_string` (`entry`, `content_default`) VALUES (35410, 'Please move to the Dungeon: {}.'), (35411, 'No dungeon name found!'); diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 9cdd311bfc27b9..c5c8601ec4d78b 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -2163,8 +2163,7 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - ChatHandler handler = ChatHandler(player->GetSession()); - handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->name.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name.c_str()); return; } @@ -2178,8 +2177,7 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - ChatHandler handler = ChatHandler(player->GetSession()); - handler.PSendSysMessage(handler.GetAcoreString(LANG_LFG_TELEPORT_DUNGEON), dungeon->name.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name.c_str()); return; } From c7a89afb0310090be8e38805cb3e5a6a57f73d6f Mon Sep 17 00:00:00 2001 From: Exitare Date: Sat, 21 Dec 2024 14:02:25 -0800 Subject: [PATCH 10/13] Remove c_str() --- src/server/game/DungeonFinding/LFGMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index c5c8601ec4d78b..cab81f47a2a963 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -2163,7 +2163,7 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name); return; } @@ -2177,7 +2177,7 @@ namespace lfg // No dungon teleport allowed if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) { - ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name); return; } From 57d29fc9cee037fd570db21fd53129ba7b207d39 Mon Sep 17 00:00:00 2001 From: Exitare Date: Wed, 25 Dec 2024 18:22:52 -0800 Subject: [PATCH 11/13] Update rev_1734657034946976800.sql --- data/sql/updates/pending_db_world/rev_1734657034946976800.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql index 1e296062d2d79a..db8597a94cbf0b 100644 --- a/data/sql/updates/pending_db_world/rev_1734657034946976800.sql +++ b/data/sql/updates/pending_db_world/rev_1734657034946976800.sql @@ -1,5 +1,5 @@ -- DELETE FROM `acore_string` WHERE `entry` IN (35410, 35411); -INSERT INTO `acore_string` (`entry`, `content_default`) VALUES +INSERT INTO `acore_string` (`entry`, `content_default`) VALUES (35410, 'Please move to the Dungeon: {}.'), (35411, 'No dungeon name found!'); From 219d6e8521f4ea410aeb2c80c02c76550cb83843 Mon Sep 17 00:00:00 2001 From: Exitare Date: Sat, 4 Jan 2025 18:09:01 -0800 Subject: [PATCH 12/13] Update lfg to take debug into account --- src/server/game/DungeonFinding/LFGMgr.cpp | 30 ++++------------------- src/server/game/DungeonFinding/LFGMgr.h | 1 + 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index cab81f47a2a963..616003365c73f9 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1725,15 +1725,6 @@ namespace lfg bool randomDungeon = false; std::vector playersTeleported; - // clear list of players to be teleported if config option is disabled - if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) - { - // Send message to all players in newly formed group - SendMessageToAllPlayers(playersToTeleport, proposal); - // clearn the player list - playersToTeleport.clear(); - } - // Teleport Player for (GuidUnorderedSet::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) { @@ -2158,29 +2149,18 @@ namespace lfg { error = LFG_TELEPORTERROR_COMBAT; } + else if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT) && !m_Testing) + { + ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name); + error = LFG_TELEPORTERROR_YOU_CANT_DO_THAT_RIGHT_NOW; + } else if (out && error == LFG_TELEPORTERROR_OK) { - // No dungon teleport allowed - if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) - { - ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name); - return; - } - if (player->GetMapId() == uint32(dungeon->map)) player->TeleportToEntryPoint(); - - return; } else { - // No dungon teleport allowed - if (!sWorld->getBoolConfig(CONFIG_LFG_TELEPORT)) - { - ChatHandler(player->GetSession()).PSendSysMessage(LANG_LFG_TELEPORT_DUNGEON, dungeon->name); - return; - } - uint32 mapid = dungeon->map; float x = dungeon->x; float y = dungeon->y; diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 5dad814bddee22..9e2d4aeaeccafe 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -92,6 +92,7 @@ namespace lfg LFG_TELEPORTERROR_IN_VEHICLE = 3, LFG_TELEPORTERROR_FATIGUE = 4, LFG_TELEPORTERROR_INVALID_LOCATION = 6, + LFG_TELEPORTERROR_YOU_CANT_DO_THAT_RIGHT_NOW = 7, LFG_TELEPORTERROR_COMBAT = 8 // FIXME - It can be 7 or 8 (Need proper data) }; From da0791ab88e6149cc9501b973de90e760a7dda9b Mon Sep 17 00:00:00 2001 From: Exitare Date: Sun, 5 Jan 2025 09:59:05 -0800 Subject: [PATCH 13/13] Remove empty line --- src/server/game/DungeonFinding/LFGMgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 616003365c73f9..2099bba3ec7ef9 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1724,7 +1724,6 @@ namespace lfg bool randomDungeon = false; std::vector playersTeleported; - // Teleport Player for (GuidUnorderedSet::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) {