Core/LFG: updated remaining lfg packets to packet class

This commit is contained in:
Ovahlord
2019-06-04 19:52:14 +02:00
parent d65c9843ee
commit 330e2f3fd0
4 changed files with 46 additions and 8 deletions

View File

@@ -1393,7 +1393,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
{
TC_LOG_DEBUG("lfg.teleport", "Player %s not in group/lfggroup or dungeon not found!",
player->GetName().c_str());
player->GetSession()->SendLfgTeleportError(uint8(LFG_TELEPORT_RESULT_NO_RETURN_LOCATION));
player->GetSession()->SendLfgTeleportError(LFG_TELEPORT_RESULT_NO_RETURN_LOCATION);
return;
}
@@ -1480,7 +1480,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
}
if (error != LFG_TELEPORT_RESULT_NONE)
player->GetSession()->SendLfgTeleportError(uint8(error));
player->GetSession()->SendLfgTeleportError(error);
TC_LOG_DEBUG("lfg.teleport", "Player %s is being teleported in to map %u "
"(x: %f, y: %f, z: %f) Result: %u", player->GetName().c_str(), dungeon->map,

View File

@@ -564,3 +564,17 @@ WorldPacket const* WorldPackets::LFG::LFGProposalUpdate::Write()
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LFGOfferContinue::Write()
{
_worldPacket << uint32(Slot);
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LFGTeleportDenied::Write()
{
_worldPacket << uint32(Reason);
return &_worldPacket;
}

View File

@@ -383,9 +383,35 @@ namespace WorldPackets
bool ProposalSilent = false;
std::vector<LFGProposalUpdatePlayer> Players;
};
class LFGDisabled final : public ServerPacket
{
public:
LFGDisabled() : ServerPacket(SMSG_LFG_DISABLED, 0) { }
WorldPacket const* Write() override { return &_worldPacket; }
};
class LFGOfferContinue final : public ServerPacket
{
public:
LFGOfferContinue(uint32 slot) : ServerPacket(SMSG_LFG_OFFER_CONTINUE, 4), Slot(slot) { }
WorldPacket const* Write() override;
uint32 Slot = 0;
};
class LFGTeleportDenied final : public ServerPacket
{
public:
LFGTeleportDenied(lfg::LfgTeleportResult reason) : ServerPacket(SMSG_LFG_TELEPORT_DENIED, 4), Reason(reason) { }
WorldPacket const* Write() override;
lfg::LfgTeleportResult Reason;
};
}
}
#endif // LFGPackets_h__

View File

@@ -87,8 +87,6 @@ namespace WorldPackets
class LFGBootPlayerVote;
class LFGTeleport;
class LFGGetSystemInfo;
class LFGPlayerInfo;
class LFGPartyInfo;
class LFGUpdateStatus;
class RoleChosen;
class LFGRoleCheckUpdate;
@@ -96,7 +94,7 @@ namespace WorldPackets
class LFGQueueStatus;
class LFGPlayerReward;
class LfgBootPlayer;
class LFGProposalUpdate;
class LFGOfferContinue;
}
}
@@ -986,7 +984,7 @@ class TC_GAME_API WorldSession
void SendLfgUpdateProposal(lfg::LfgProposal const& proposal);
void SendLfgDisabled();
void SendLfgOfferContinue(uint32 dungeonEntry);
void SendLfgTeleportError(uint8 err);
void SendLfgTeleportError(lfg::LfgTeleportResult err);
// Arena Team
void HandleInspectArenaTeamsOpcode(WorldPacket& recvData);