aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/LFGHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/LFGHandler.cpp')
-rw-r--r--src/server/game/Handlers/LFGHandler.cpp36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp
index 40daa756b3d..621ad554277 100644
--- a/src/server/game/Handlers/LFGHandler.cpp
+++ b/src/server/game/Handlers/LFGHandler.cpp
@@ -15,7 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "DBCStores.h"
#include "LFGMgr.h"
+#include "LFGPackets.h"
#include "Log.h"
#include "GameTime.h"
#include "Group.h"
@@ -46,50 +48,34 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, lfg::LfgLockPartyMap const& l
}
}
-void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData)
+void WorldSession::HandleLfgJoinOpcode(WorldPackets::LFG::LFGJoin& packet)
{
if (!sLFGMgr->isOptionEnabled(lfg::LFG_OPTION_ENABLE_DUNGEON_FINDER | lfg::LFG_OPTION_ENABLE_RAID_BROWSER) ||
(GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() &&
(GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup())))
- {
- recvData.rfinish();
return;
- }
-
- uint8 numDungeons;
- uint32 roles;
- recvData >> roles;
- recvData.read_skip<uint16>(); // uint8 (always 0) - uint8 (always 0)
- recvData >> numDungeons;
- if (!numDungeons)
+ if (packet.Slots.empty())
{
TC_LOG_DEBUG("lfg", "CMSG_LFG_JOIN %s no dungeons selected", GetPlayerInfo().c_str());
- recvData.rfinish();
return;
}
lfg::LfgDungeonSet newDungeons;
- for (int8 i = 0; i < numDungeons; ++i)
+ for (uint32 slot : packet.Slots)
{
- uint32 dungeon;
- recvData >> dungeon;
- dungeon &= 0x00FFFFFF; // remove the type from the dungeon entry
- if (dungeon)
+ uint32 dungeon = slot & 0x00FFFFFF; // remove the type from the dungeon entry
+ if (sLFGDungeonStore.LookupEntry(dungeon))
newDungeons.insert(dungeon);
}
- recvData.read_skip<uint32>(); // for 0..uint8 (always 3) { uint8 (always 0) }
-
- std::string comment;
- recvData >> comment;
- TC_LOG_DEBUG("lfg", "CMSG_LFG_JOIN %s roles: %u, Dungeons: %u, Comment: %s",
- GetPlayerInfo().c_str(), roles, uint8(newDungeons.size()), comment.c_str());
+ TC_LOG_DEBUG("lfg", "CMSG_LFG_JOIN %s roles: %u, Dungeons: " SZFMTD ", Comment: %s",
+ GetPlayerInfo().c_str(), packet.Roles, newDungeons.size(), packet.Comment.c_str());
- sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment);
+ sLFGMgr->JoinLfg(GetPlayer(), uint8(packet.Roles), newDungeons, packet.Comment);
}
-void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/)
+void WorldSession::HandleLfgLeaveOpcode(WorldPackets::LFG::LFGLeave& /*packet*/)
{
Group* group = GetPlayer()->GetGroup();
ObjectGuid guid = GetPlayer()->GetGUID();