From a1edddd1f0f59a715eb83e0a6d78db780e8a102a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 21:24:42 -0700 Subject: [PATCH] feat: open dungeon finder UI when server sends SMSG_OPEN_LFG_DUNGEON_FINDER Previously SMSG_OPEN_LFG_DUNGEON_FINDER was consumed silently with no UI response. Now it fires an OpenLfgCallback wired to openDungeonFinder() on the GameScreen, so the dungeon finder window opens as the server requests. --- include/game/game_handler.hpp | 5 +++++ include/ui/game_screen.hpp | 1 + src/core/application.cpp | 5 +++++ src/game/game_handler.cpp | 6 +++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index a11cd067..1cdd20ea 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -1625,6 +1625,10 @@ public: using TaxiFlightStartCallback = std::function; void setTaxiFlightStartCallback(TaxiFlightStartCallback cb) { taxiFlightStartCallback_ = std::move(cb); } + // Callback fired when server sends SMSG_OPEN_LFG_DUNGEON_FINDER (open dungeon finder UI) + using OpenLfgCallback = std::function; + void setOpenLfgCallback(OpenLfgCallback cb) { openLfgCallback_ = std::move(cb); } + bool isMounted() const { return currentMountDisplayId_ != 0; } bool isHostileAttacker(uint64_t guid) const { return hostileAttackers_.count(guid) > 0; } float getServerRunSpeed() const { return serverRunSpeed_; } @@ -2916,6 +2920,7 @@ private: TaxiPrecacheCallback taxiPrecacheCallback_; TaxiOrientationCallback taxiOrientationCallback_; TaxiFlightStartCallback taxiFlightStartCallback_; + OpenLfgCallback openLfgCallback_; uint32_t currentMountDisplayId_ = 0; uint32_t mountAuraSpellId_ = 0; // Spell ID of the aura that caused mounting (for CMSG_CANCEL_AURA fallback) float serverRunSpeed_ = 7.0f; diff --git a/include/ui/game_screen.hpp b/include/ui/game_screen.hpp index 0fb98ba3..32428fcc 100644 --- a/include/ui/game_screen.hpp +++ b/include/ui/game_screen.hpp @@ -641,6 +641,7 @@ public: uint32_t str = 0, uint32_t agi = 0, uint32_t sta = 0, uint32_t intel = 0, uint32_t spi = 0); void triggerAchievementToast(uint32_t achievementId, std::string name = {}); + void openDungeonFinder() { showDungeonFinder_ = true; } }; } // namespace ui diff --git a/src/core/application.cpp b/src/core/application.cpp index 396c260f..0feba036 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2550,6 +2550,11 @@ void Application::setupUICallbacks() { } }); + // Open dungeon finder callback — server sends SMSG_OPEN_LFG_DUNGEON_FINDER + gameHandler->setOpenLfgCallback([this]() { + if (uiManager) uiManager->getGameScreen().openDungeonFinder(); + }); + // Creature move callback (online mode) - update creature positions gameHandler->setCreatureMoveCallback([this](uint64_t guid, float x, float y, float z, uint32_t durationMs) { if (!renderer || !renderer->getCharacterRenderer()) return; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 6ade8017..7c96b73a 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -5133,10 +5133,14 @@ void GameHandler::handlePacket(network::Packet& packet) { case Opcode::SMSG_UPDATE_LFG_LIST: case Opcode::SMSG_LFG_PLAYER_INFO: case Opcode::SMSG_LFG_PARTY_INFO: - case Opcode::SMSG_OPEN_LFG_DUNGEON_FINDER: // Informational LFG packets not yet surfaced in UI — consume silently. packet.setReadPos(packet.getSize()); break; + case Opcode::SMSG_OPEN_LFG_DUNGEON_FINDER: + // Server requests client to open the dungeon finder UI + packet.setReadPos(packet.getSize()); // consume any payload + if (openLfgCallback_) openLfgCallback_(); + break; case Opcode::SMSG_ARENA_TEAM_COMMAND_RESULT: handleArenaTeamCommandResult(packet);