Core/PacketIO: Updated and enabled LFG packets

This commit is contained in:
Shauren
2017-07-12 00:05:41 +02:00
parent 42622aa3d4
commit 0d06fcee17
22 changed files with 1249 additions and 721 deletions

View File

@@ -993,7 +993,7 @@ void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
if (SendPacket)
{
WorldPackets::Battleground::BattlefieldStatusNone battlefieldStatus;
sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), player->GetBattlegroundQueueJoinTime(bgQueueTypeId), m_ArenaType);
sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), player->GetBattlegroundQueueJoinTime(bgQueueTypeId));
player->SendDirectMessage(battlefieldStatus.Write());
}

View File

@@ -169,7 +169,7 @@ void BattlegroundMgr::BuildBattlegroundStatusHeader(WorldPackets::Battleground::
{
header->Ticket.RequesterGuid = player->GetGUID();
header->Ticket.Id = ticketId;
header->Ticket.Type = bg->isArena() ? arenaType : 1;
header->Ticket.Type = WorldPackets::LFG::RideType::Battlegrounds;
header->Ticket.Time = joinTime;
header->QueueID = bg->GetQueueId();
header->RangeMin = bg->GetMinLevel();
@@ -180,11 +180,11 @@ void BattlegroundMgr::BuildBattlegroundStatusHeader(WorldPackets::Battleground::
header->TournamentRules = false;
}
void BattlegroundMgr::BuildBattlegroundStatusNone(WorldPackets::Battleground::BattlefieldStatusNone* battlefieldStatus, Player* player, uint32 ticketId, uint32 joinTime, uint32 arenaType)
void BattlegroundMgr::BuildBattlegroundStatusNone(WorldPackets::Battleground::BattlefieldStatusNone* battlefieldStatus, Player* player, uint32 ticketId, uint32 joinTime)
{
battlefieldStatus->Ticket.RequesterGuid = player->GetGUID();
battlefieldStatus->Ticket.Id = ticketId;
battlefieldStatus->Ticket.Type = arenaType;
battlefieldStatus->Ticket.Type = WorldPackets::LFG::RideType::Battlegrounds;
battlefieldStatus->Ticket.Time = joinTime;
}
@@ -220,7 +220,7 @@ void BattlegroundMgr::BuildBattlegroundStatusFailed(WorldPackets::Battleground::
{
battlefieldStatus->Ticket.RequesterGuid = pPlayer->GetGUID();
battlefieldStatus->Ticket.Id = ticketId;
battlefieldStatus->Ticket.Type = arenaType;
battlefieldStatus->Ticket.Type = WorldPackets::LFG::RideType::Battlegrounds;
battlefieldStatus->Ticket.Time = pPlayer->GetBattlegroundQueueJoinTime(BGQueueTypeId(bg->GetTypeID(), arenaType));
battlefieldStatus->QueueID = bg->GetQueueId();
battlefieldStatus->Reason = result;

View File

@@ -88,7 +88,7 @@ class TC_GAME_API BattlegroundMgr
/* Packet Building */
void SendBattlegroundList(Player* player, ObjectGuid const& guid, BattlegroundTypeId bgTypeId);
void BuildBattlegroundStatusHeader(WorldPackets::Battleground::BattlefieldStatusHeader* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, uint32 arenaType);
void BuildBattlegroundStatusNone(WorldPackets::Battleground::BattlefieldStatusNone* battlefieldStatus, Player* player, uint32 ticketId, uint32 joinTime, uint32 arenaType);
void BuildBattlegroundStatusNone(WorldPackets::Battleground::BattlefieldStatusNone* battlefieldStatus, Player* player, uint32 ticketId, uint32 joinTime);
void BuildBattlegroundStatusNeedConfirmation(WorldPackets::Battleground::BattlefieldStatusNeedConfirmation* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, uint32 timeout, uint32 arenaType);
void BuildBattlegroundStatusActive(WorldPackets::Battleground::BattlefieldStatusActive* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, uint32 arenaType);
void BuildBattlegroundStatusQueued(WorldPackets::Battleground::BattlefieldStatusQueued* battlefieldStatus, Battleground* bg, Player* player, uint32 ticketId, uint32 joinTime, uint32 avgWaitTime, uint32 arenaType, bool asGroup);

View File

@@ -398,7 +398,7 @@ void BattlegroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
// queue->removeplayer, it causes bugs
WorldPackets::Battleground::BattlefieldStatusNone battlefieldStatus;
sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, plr2, queueSlot, plr2->GetBattlegroundQueueJoinTime(bgQueueTypeId), group->ArenaType);
sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, plr2, queueSlot, plr2->GetBattlegroundQueueJoinTime(bgQueueTypeId));
plr2->SendDirectMessage(battlefieldStatus.Write());
}
// then actually delete, this may delete the group as well!
@@ -1080,7 +1080,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
sBattlegroundMgr->ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId());
WorldPackets::Battleground::BattlefieldStatusNone battlefieldStatus;
sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, player, queueSlot, player->GetBattlegroundQueueJoinTime(m_BgQueueTypeId), m_ArenaType);
sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, player, queueSlot, player->GetBattlegroundQueueJoinTime(m_BgQueueTypeId));
player->SendDirectMessage(battlefieldStatus.Write());
}
}

View File

@@ -55,17 +55,21 @@ enum LfgUpdateType
LFG_UPDATETYPE_PROPOSAL_DECLINED = 10,
LFG_UPDATETYPE_GROUP_FOUND = 11,
LFG_UPDATETYPE_ADDED_TO_QUEUE = 13,
LFG_UPDATETYPE_PROPOSAL_BEGIN = 14,
LFG_UPDATETYPE_UPDATE_STATUS = 15,
LFG_UPDATETYPE_GROUP_MEMBER_OFFLINE = 16,
LFG_UPDATETYPE_GROUP_DISBAND_UNK16 = 17, // FIXME: Sometimes at group disband
LFG_UPDATETYPE_JOIN_QUEUE_INITIAL = 24,
LFG_UPDATETYPE_DUNGEON_FINISHED = 25,
LFG_UPDATETYPE_PARTY_ROLE_NOT_AVAILABLE = 43,
LFG_UPDATETYPE_JOIN_LFG_OBJECT_FAILED = 45,
LFG_UPDATETYPE_SUSPENDED_QUEUE = 14,
LFG_UPDATETYPE_PROPOSAL_BEGIN = 15,
LFG_UPDATETYPE_UPDATE_STATUS = 16,
LFG_UPDATETYPE_GROUP_MEMBER_OFFLINE = 17,
LFG_UPDATETYPE_GROUP_DISBAND_UNK16 = 18, // FIXME: Sometimes at group disband
LFG_UPDATETYPE_JOIN_QUEUE_INITIAL = 25,
LFG_UPDATETYPE_DUNGEON_FINISHED = 26,
LFG_UPDATETYPE_PARTY_ROLE_NOT_AVAILABLE = 46,
LFG_UPDATETYPE_JOIN_LFG_OBJECT_FAILED = 48,
LFG_UPDATETYPE_REMOVED_LEVELUP = 49,
LFG_UPDATETYPE_REMOVED_XP_TOGGLE = 50,
LFG_UPDATETYPE_REMOVED_FACTION_CHANGE = 51
};
enum LfgState
enum LfgState : uint8
{
LFG_STATE_NONE, // Not using LFG / LFR
LFG_STATE_ROLECHECK, // Rolecheck active
@@ -77,6 +81,15 @@ enum LfgState
LFG_STATE_RAIDBROWSER // Using Raid finder
};
enum LfgQueueType
{
LFG_QUEUE_DUNGEON = 1,
LFG_QUEUE_LFR = 2,
LFG_QUEUE_SCENARIO = 3,
LFG_QUEUE_FLEX = 4,
LFG_QUEUE_WORLD_PVP = 5
};
/// Instance lock types
enum LfgLockStatusType
{

View File

@@ -422,21 +422,21 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
// Check player or group member restrictions
if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER))
joinData.result = LFG_JOIN_NOT_MEET_REQS;
joinData.result = LFG_JOIN_NO_SLOTS_PLAYER;
else if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue())
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
joinData.result = LFG_JOIN_CANT_USE_DUNGEONS;
else if (player->HasAura(LFG_SPELL_DUNGEON_DESERTER))
joinData.result = LFG_JOIN_DESERTER;
joinData.result = LFG_JOIN_DESERTER_PLAYER;
else if (player->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
joinData.result = LFG_JOIN_RANDOM_COOLDOWN;
joinData.result = LFG_JOIN_RANDOM_COOLDOWN_PLAYER;
else if (dungeons.empty())
joinData.result = LFG_JOIN_NOT_MEET_REQS;
joinData.result = LFG_JOIN_NO_SLOTS_PLAYER;
else if (player->HasAura(9454)) // check Freeze debuff
joinData.result = LFG_JOIN_NOT_MEET_REQS;
joinData.result = LFG_JOIN_NO_SLOTS_PLAYER;
else if (grp)
{
if (grp->GetMembersCount() > MAX_GROUP_SIZE)
joinData.result = LFG_JOIN_TOO_MUCH_MEMBERS;
joinData.result = LFG_JOIN_TOO_MANY_MEMBERS;
else
{
uint8 memberCount = 0;
@@ -445,13 +445,13 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
if (Player* plrg = itr->GetSource())
{
if (!plrg->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER))
joinData.result = LFG_JOIN_INTERNAL_ERROR;
joinData.result = LFG_JOIN_NO_LFG_OBJECT;
if (plrg->HasAura(LFG_SPELL_DUNGEON_DESERTER))
joinData.result = LFG_JOIN_PARTY_DESERTER;
joinData.result = LFG_JOIN_DESERTER_PARTY;
else if (plrg->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
joinData.result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
joinData.result = LFG_JOIN_RANDOM_COOLDOWN_PARTY;
else if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue())
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
joinData.result = LFG_JOIN_CANT_USE_DUNGEONS;
else if (plrg->HasAura(9454)) // check Freeze debuff
joinData.result = LFG_JOIN_PARTY_NOT_MEET_REQS;
++memberCount;
@@ -460,7 +460,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
}
if (joinData.result == LFG_JOIN_OK && memberCount != grp->GetMembersCount())
joinData.result = LFG_JOIN_DISCONNECTED;
joinData.result = LFG_JOIN_MEMBERS_NOT_PRESENT;
}
}
else
@@ -478,23 +478,23 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
{
case LFG_TYPE_RANDOM:
if (dungeons.size() > 1) // Only allow 1 random dungeon
joinData.result = LFG_JOIN_DUNGEON_INVALID;
joinData.result = LFG_JOIN_INVALID_SLOT;
else
rDungeonId = (*dungeons.begin());
// No break on purpose (Random can only be dungeon or heroic dungeon)
case LFG_TYPE_HEROIC:
case LFG_TYPE_DUNGEON:
if (isRaid)
joinData.result = LFG_JOIN_MIXED_RAID_DUNGEON;
joinData.result = LFG_JOIN_MISMATCHED_SLOTS;
isDungeon = true;
break;
case LFG_TYPE_RAID:
if (isDungeon)
joinData.result = LFG_JOIN_MIXED_RAID_DUNGEON;
joinData.result = LFG_JOIN_MISMATCHED_SLOTS;
isRaid = true;
break;
default:
joinData.result = LFG_JOIN_DUNGEON_INVALID;
joinData.result = LFG_JOIN_INVALID_SLOT;
break;
}
}
@@ -509,7 +509,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
// if we have lockmap then there are no compatible dungeons
GetCompatibleDungeons(dungeons, players, joinData.lockmap, isContinue);
if (dungeons.empty())
joinData.result = grp ? LFG_JOIN_INTERNAL_ERROR : LFG_JOIN_NOT_MEET_REQS;
joinData.result = grp ? LFG_JOIN_NO_LFG_OBJECT : LFG_JOIN_NO_SLOTS_PLAYER;
}
}
@@ -531,6 +531,11 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
return;
}
WorldPackets::LFG::RideTicket ticket;
ticket.RequesterGuid = guid;
ticket.Id = GetQueueId(gguid);
ticket.Type = WorldPackets::LFG::RideType::Lfg;
ticket.Time = int32(time(nullptr));
std::string debugNames = "";
if (grp) // Begin rolecheck
{
@@ -558,6 +563,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
ObjectGuid pguid = plrg->GetGUID();
plrg->GetSession()->SendLfgUpdateStatus(updateData, true);
SetState(pguid, LFG_STATE_ROLECHECK);
SetTicket(pguid, ticket);
if (!isContinue)
SetSelectedDungeons(pguid, dungeons);
roleCheck.roles[pguid] = 0;
@@ -586,10 +592,12 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
SetSelectedDungeons(guid, dungeons);
}
// Send update to player
player->GetSession()->SendLfgJoinResult(joinData);
player->GetSession()->SendLfgUpdateStatus(LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons), false);
SetState(gguid, LFG_STATE_QUEUED);
SetTicket(guid, ticket);
SetRoles(guid, roles);
player->GetSession()->SendLfgUpdateStatus(LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE_INITIAL, dungeons), false);
SetState(guid, LFG_STATE_QUEUED);
player->GetSession()->SendLfgUpdateStatus(LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, dungeons), false);
player->GetSession()->SendLfgJoinResult(joinData);
debugNames.append(player->GetName());
}
@@ -670,6 +678,15 @@ void LFGMgr::LeaveLfg(ObjectGuid guid, bool disconnected)
}
}
WorldPackets::LFG::RideTicket const* LFGMgr::GetTicket(ObjectGuid guid) const
{
auto itr = PlayersStore.find(guid);
if (itr != PlayersStore.end())
return &itr->second.GetTicket();
return nullptr;
}
/**
Update the Role check info with the player selected role.
@@ -717,11 +734,7 @@ void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid::
else
dungeons = roleCheck.dungeons;
LfgJoinResult joinResult = LFG_JOIN_FAILED;
if (roleCheck.state == LFG_ROLECHECK_MISSING_ROLE || roleCheck.state == LFG_ROLECHECK_WRONG_ROLES)
joinResult = LFG_JOIN_ROLE_CHECK_FAILED;
LfgJoinResultData joinData = LfgJoinResultData(joinResult, roleCheck.state);
LfgJoinResultData joinData = LfgJoinResultData(LFG_JOIN_ROLE_CHECK_FAILED, roleCheck.state);
for (LfgRolesMap::const_iterator it = roleCheck.roles.begin(); it != roleCheck.roles.end(); ++it)
{
ObjectGuid pguid = it->first;
@@ -1282,7 +1295,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_TELEPORTERROR_INVALID_LOCATION));
player->GetSession()->SendLfgTeleportError(LFG_TELEPORT_RESULT_NO_RETURN_LOCATION);
return;
}
@@ -1296,20 +1309,20 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
return;
}
LfgTeleportError error = LFG_TELEPORTERROR_OK;
LfgTeleportResult error = LFG_TELEPORT_RESULT_NONE;
if (!player->IsAlive())
error = LFG_TELEPORTERROR_PLAYER_DEAD;
error = LFG_TELEPORT_RESULT_DEAD;
else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
error = LFG_TELEPORTERROR_FALLING;
error = LFG_TELEPORT_RESULT_FALLING;
else if (player->IsMirrorTimerActive(FATIGUE_TIMER))
error = LFG_TELEPORTERROR_FATIGUE;
error = LFG_TELEPORT_RESULT_EXHAUSTION;
else if (player->GetVehicle())
error = LFG_TELEPORTERROR_IN_VEHICLE;
error = LFG_TELEPORT_RESULT_ON_TRANSPORT;
else if (!player->GetCharmGUID().IsEmpty())
error = LFG_TELEPORTERROR_CHARMING;
error = LFG_TELEPORT_RESULT_IMMUNE_TO_SUMMONS;
else if (player->HasAura(9454)) // check Freeze debuff
error = LFG_TELEPORTERROR_INVALID_LOCATION;
error = LFG_TELEPORT_RESULT_NO_RETURN_LOCATION;
else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance
{
uint32 mapid = dungeon->map;
@@ -1346,13 +1359,13 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
}
if (!player->TeleportTo(mapid, x, y, z, orientation))
error = LFG_TELEPORTERROR_INVALID_LOCATION;
error = LFG_TELEPORT_RESULT_NO_RETURN_LOCATION;
}
else
error = LFG_TELEPORTERROR_INVALID_LOCATION;
error = LFG_TELEPORT_RESULT_NO_RETURN_LOCATION;
if (error != LFG_TELEPORTERROR_OK)
player->GetSession()->SendLfgTeleportError(uint8(error));
if (error != LFG_TELEPORT_RESULT_NONE)
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,
@@ -1744,6 +1757,11 @@ void LFGMgr::DecreaseKicksLeft(ObjectGuid guid)
TC_LOG_TRACE("lfg.data.group.kicksleft.decrease", "Group: %s, Kicks: %u", guid.ToString().c_str(), GroupsStore[guid].GetKicksLeft());
}
void LFGMgr::SetTicket(ObjectGuid guid, WorldPackets::LFG::RideTicket const& ticket)
{
PlayersStore[guid].SetTicket(ticket);
}
void LFGMgr::RemovePlayerData(ObjectGuid guid)
{
TC_LOG_TRACE("lfg.data.player.remove", "Player: %s", guid.ToString().c_str());

View File

@@ -32,6 +32,14 @@ class Quest;
struct LfgDungeonsEntry;
enum Difficulty : uint8;
namespace WorldPackets
{
namespace LFG
{
struct RideTicket;
}
}
namespace lfg
{
@@ -80,40 +88,51 @@ enum LfgProposalState
};
/// Teleport errors
enum LfgTeleportError
enum LfgTeleportResult : uint8
{
// 7 = "You can't do that right now" | 5 = No client reaction
LFG_TELEPORTERROR_OK = 0, // Internal use
LFG_TELEPORTERROR_PLAYER_DEAD = 1,
LFG_TELEPORTERROR_FALLING = 2,
LFG_TELEPORTERROR_IN_VEHICLE = 3,
LFG_TELEPORTERROR_FATIGUE = 4,
LFG_TELEPORTERROR_INVALID_LOCATION = 6,
LFG_TELEPORTERROR_CHARMING = 8 // FIXME - It can be 7 or 8 (Need proper data)
LFG_TELEPORT_RESULT_NONE = 0, // Internal use
LFG_TELEPORT_RESULT_DEAD = 1,
LFG_TELEPORT_RESULT_FALLING = 2,
LFG_TELEPORT_RESULT_ON_TRANSPORT = 3,
LFG_TELEPORT_RESULT_EXHAUSTION = 4,
LFG_TELEPORT_RESULT_NO_RETURN_LOCATION = 6,
LFG_TELEPORT_RESULT_IMMUNE_TO_SUMMONS = 8 // FIXME - It can be 7 or 8 (Need proper data)
// unknown values
//LFG_TELEPORT_RESULT_NOT_IN_DUNGEON,
//LFG_TELEPORT_RESULT_NOT_ALLOWED,
//LFG_TELEPORT_RESULT_ALREADY_IN_DUNGEON
};
/// Queue join results
enum LfgJoinResult
{
// 3 = No client reaction | 18 = "Rolecheck failed"
LFG_JOIN_OK = 0x00, // Joined (no client msg)
LFG_JOIN_FAILED = 0x1B, // RoleCheck Failed
LFG_JOIN_GROUPFULL = 0x1C, // Your group is full
LFG_JOIN_INTERNAL_ERROR = 0x1E, // Internal LFG Error
LFG_JOIN_NOT_MEET_REQS = 0x1F, // You do not meet the requirements for the chosen dungeons
LFG_JOIN_PARTY_NOT_MEET_REQS = 6, // One or more party members do not meet the requirements for the chosen dungeons (FIXME)
LFG_JOIN_MIXED_RAID_DUNGEON = 0x20, // You cannot mix dungeons, raids, and random when picking dungeons
LFG_JOIN_MULTI_REALM = 0x21, // The dungeon you chose does not support players from multiple realms
LFG_JOIN_DISCONNECTED = 0x22, // One or more party members are pending invites or disconnected
LFG_JOIN_PARTY_INFO_FAILED = 0x23, // Could not retrieve information about some party members
LFG_JOIN_DUNGEON_INVALID = 0x24, // One or more dungeons was not valid
LFG_JOIN_DESERTER = 0x25, // You can not queue for dungeons until your deserter debuff wears off
LFG_JOIN_PARTY_DESERTER = 0x26, // One or more party members has a deserter debuff
LFG_JOIN_RANDOM_COOLDOWN = 0x27, // You can not queue for random dungeons while on random dungeon cooldown
LFG_JOIN_PARTY_RANDOM_COOLDOWN = 0x28, // One or more party members are on random dungeon cooldown
LFG_JOIN_TOO_MUCH_MEMBERS = 0x29, // You can not enter dungeons with more that 5 party members
LFG_JOIN_USING_BG_SYSTEM = 0x2A, // You can not use the dungeon system while in BG or arenas
LFG_JOIN_ROLE_CHECK_FAILED = 0x2B // Role check failed, client shows special error
LFG_JOIN_OK = 0x00, // Joined (no client msg)
LFG_JOIN_GROUP_FULL = 0x1F, // Your group is already full.
LFG_JOIN_NO_LFG_OBJECT = 0x21, // Internal LFG Error.
LFG_JOIN_NO_SLOTS_PLAYER = 0x22, // You do not meet the requirements for the chosen dungeons.
LFG_JOIN_MISMATCHED_SLOTS = 0x23, // You cannot mix dungeons, raids, and random when picking dungeons.
LFG_JOIN_PARTY_PLAYERS_FROM_DIFFERENT_REALMS = 0x24, // The dungeon you chose does not support players from multiple realms.
LFG_JOIN_MEMBERS_NOT_PRESENT = 0x25, // One or more group members are pending invites or disconnected.
LFG_JOIN_GET_INFO_TIMEOUT = 0x26, // Could not retrieve information about some party members.
LFG_JOIN_INVALID_SLOT = 0x27, // One or more dungeons was not valid.
LFG_JOIN_DESERTER_PLAYER = 0x28, // You can not queue for dungeons until your deserter debuff wears off.
LFG_JOIN_DESERTER_PARTY = 0x29, // One or more party members has a deserter debuff.
LFG_JOIN_RANDOM_COOLDOWN_PLAYER = 0x2A, // You can not queue for random dungeons while on random dungeon cooldown.
LFG_JOIN_RANDOM_COOLDOWN_PARTY = 0x2B, // One or more party members are on random dungeon cooldown.
LFG_JOIN_TOO_MANY_MEMBERS = 0x2C, // You have too many group members to queue for that.
LFG_JOIN_CANT_USE_DUNGEONS = 0x2D, // You cannot queue for a dungeon or raid while using battlegrounds or arenas.
LFG_JOIN_ROLE_CHECK_FAILED = 0x2E, // The Role Check has failed.
LFG_JOIN_TOO_FEW_MEMBERS = 0x34, // You do not have enough group members to queue for that.
LFG_JOIN_REASON_TOO_MANY_LFG = 0x35, // You are queued for too many instances.
LFG_JOIN_MISMATCHED_SLOTS_LOCAL_XREALM = 0x37, // You cannot mix realm-only and x-realm entries when listing your name in other raids.
LFG_JOIN_ALREADY_USING_LFG_LIST = 0x3F, // You can't do that while using Premade Groups.
LFG_JOIN_NOT_LEADER = 0x45, // You are not the party leader.
LFG_JOIN_DEAD = 0x49,
LFG_JOIN_PARTY_NOT_MEET_REQS = 6, // One or more party members do not meet the requirements for the chosen dungeons (FIXME)
};
/// Role check states
@@ -178,14 +197,13 @@ struct LfgUpdateData
// Data needed by SMSG_LFG_QUEUE_STATUS
struct LfgQueueStatusData
{
LfgQueueStatusData(uint8 _queueId = 0, uint32 _dungeonId = 0, time_t _joinTime = 0, int32 _waitTime = -1, int32 _waitTimeAvg = -1, int32 _waitTimeTank = -1, int32 _waitTimeHealer = -1,
LfgQueueStatusData(uint8 _queueId = 0, uint32 _dungeonId = 0, int32 _waitTime = -1, int32 _waitTimeAvg = -1, int32 _waitTimeTank = -1, int32 _waitTimeHealer = -1,
int32 _waitTimeDps = -1, uint32 _queuedTime = 0, uint8 _tanks = 0, uint8 _healers = 0, uint8 _dps = 0) :
queueId(_queueId), dungeonId(_dungeonId), joinTime(_joinTime), waitTime(_waitTime), waitTimeAvg(_waitTimeAvg), waitTimeTank(_waitTimeTank),
queueId(_queueId), dungeonId(_dungeonId), waitTime(_waitTime), waitTimeAvg(_waitTimeAvg), waitTimeTank(_waitTimeTank),
waitTimeHealer(_waitTimeHealer), waitTimeDps(_waitTimeDps), queuedTime(_queuedTime), tanks(_tanks), healers(_healers), dps(_dps) { }
uint8 queueId;
uint32 dungeonId;
time_t joinTime;
int32 waitTime;
int32 waitTimeAvg;
int32 waitTimeTank;
@@ -393,6 +411,8 @@ class TC_GAME_API LFGMgr
void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons);
/// Leaves lfg
void LeaveLfg(ObjectGuid guid, bool disconnected = false);
/// Gets unique join queue data
WorldPackets::LFG::RideTicket const* GetTicket(ObjectGuid guid) const;
// LfgQueue
/// Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
@@ -423,6 +443,7 @@ class TC_GAME_API LFGMgr
void SetDungeon(ObjectGuid guid, uint32 dungeon);
void SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons);
void DecreaseKicksLeft(ObjectGuid guid);
void SetTicket(ObjectGuid guid, WorldPackets::LFG::RideTicket const& ticket);
void SetState(ObjectGuid guid, LfgState state);
void SetVoteKick(ObjectGuid gguid, bool active);
void RemovePlayerData(ObjectGuid guid);

View File

@@ -26,6 +26,11 @@ LfgPlayerData::LfgPlayerData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NO
LfgPlayerData::~LfgPlayerData() { }
void LfgPlayerData::SetTicket(WorldPackets::LFG::RideTicket const& ticket)
{
m_Ticket = ticket;
}
void LfgPlayerData::SetState(LfgState state)
{
switch (state)
@@ -73,6 +78,11 @@ void LfgPlayerData::SetSelectedDungeons(LfgDungeonSet const& dungeons)
m_SelectedDungeons = dungeons;
}
WorldPackets::LFG::RideTicket const& LfgPlayerData::GetTicket() const
{
return m_Ticket;
}
LfgState LfgPlayerData::GetState() const
{
return m_State;

View File

@@ -19,6 +19,7 @@
#define _LFGPLAYERDATA_H
#include "LFG.h"
#include "LFGPacketsCommon.h"
namespace lfg
{
@@ -33,6 +34,7 @@ class TC_GAME_API LfgPlayerData
~LfgPlayerData();
// General
void SetTicket(WorldPackets::LFG::RideTicket const& ticket);
void SetState(LfgState state);
void RestoreState();
void SetTeam(uint8 team);
@@ -43,6 +45,7 @@ class TC_GAME_API LfgPlayerData
void SetSelectedDungeons(const LfgDungeonSet& dungeons);
// General
WorldPackets::LFG::RideTicket const& GetTicket() const;
LfgState GetState() const;
LfgState GetOldState() const;
uint8 GetTeam() const;
@@ -54,6 +57,7 @@ class TC_GAME_API LfgPlayerData
private:
// General
WorldPackets::LFG::RideTicket m_Ticket; ///< Join ticket
LfgState m_State; ///< State if group in LFG
LfgState m_OldState; ///< Old State - Used to restore state after failed Rolecheck/Proposal
// Player

View File

@@ -621,7 +621,7 @@ void LFGQueue::UpdateQueueTimers(uint8 queueId, time_t currTime)
if (queueinfo.bestCompatible.empty())
FindBestCompatibleInQueue(itQueue);
LfgQueueStatusData queueData(queueId, dungeonId, queueinfo.joinTime, waitTime, wtAvg, wtTank, wtHealer, wtDps, queuedTime, queueinfo.tanks, queueinfo.healers, queueinfo.dps);
LfgQueueStatusData queueData(queueId, dungeonId, waitTime, wtAvg, wtTank, wtHealer, wtDps, queuedTime, queueinfo.tanks, queueinfo.healers, queueinfo.dps);
for (LfgRolesMap::const_iterator itPlayer = queueinfo.roles.begin(); itPlayer != queueinfo.roles.end(); ++itPlayer)
{
ObjectGuid pguid = itPlayer->first;

View File

@@ -42,10 +42,7 @@ void LFGPlayerScript::OnLogout(Player* player)
return;
if (!player->GetGroup())
{
player->GetSession()->SendLfgLfrList(false);
sLFGMgr->LeaveLfg(player->GetGUID());
}
else if (player->GetSession()->PlayerDisconnected())
sLFGMgr->LeaveLfg(player->GetGUID(), true);
}

View File

@@ -150,18 +150,6 @@ void ObjectGuid::SetRawValue(std::vector<uint8> const& guid)
memcpy(this, guid.data(), sizeof(*this));
}
uint8& ObjectGuid::operator[](uint32 index)
{
ASSERT(index < sizeof(uint64) * 2);
return ((uint8*)&_low)[index];
}
uint8 const& ObjectGuid::operator[](uint32 index) const
{
ASSERT(index < sizeof(uint64) * 2);
return ((uint8 const*)&_low)[index];
}
ByteBuffer& operator<<(ByteBuffer& buf, ObjectGuid const& guid)
{
uint8 lowMask = 0;

View File

@@ -247,9 +247,6 @@ class TC_GAME_API ObjectGuid
LowType GetMaxCounter() const { return GetMaxCounter(GetHigh()); }
uint8& operator[](uint32 index);
uint8 const& operator[](uint32 index) const;
bool IsEmpty() const { return _low == 0 && _high == 0; }
bool IsCreature() const { return GetHigh() == HighGuid::Creature; }
bool IsPet() const { return GetHigh() == HighGuid::Pet; }

View File

@@ -1496,7 +1496,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
{
partyUpdate.LfgInfos = boost::in_place();
partyUpdate.LfgInfos->Slot = sLFGMgr->GetDungeon(m_guid);
partyUpdate.LfgInfos->Slot = sLFGMgr->GetLFGDungeonEntry(sLFGMgr->GetDungeon(m_guid));
partyUpdate.LfgInfos->BootCount = 0;
partyUpdate.LfgInfos->Aborted = false;

View File

@@ -255,7 +255,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
if (!_player->InBattlegroundQueue())
{
TC_LOG_DEBUG("bg.battleground", "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, AcceptedInvite: %u. Player not in queue!",
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, battlefieldPort.Ticket.Type, battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, uint32(battlefieldPort.Ticket.Type), battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
return;
}
@@ -263,7 +263,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
if (bgQueueTypeId == BATTLEGROUND_QUEUE_NONE)
{
TC_LOG_DEBUG("bg.battleground", "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, AcceptedInvite: %u. Invalid queueSlot!",
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, battlefieldPort.Ticket.Type, battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, uint32(battlefieldPort.Ticket.Type), battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
return;
}
@@ -274,14 +274,14 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo))
{
TC_LOG_DEBUG("bg.battleground", "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, AcceptedInvite: %u. Player not in queue (No player Group Info)!",
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, battlefieldPort.Ticket.Type, battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, uint32(battlefieldPort.Ticket.Type), battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
return;
}
// if action == 1, then player must have been invited to join
if (!ginfo.IsInvitedToBGInstanceGUID && battlefieldPort.AcceptedInvite)
{
TC_LOG_DEBUG("bg.battleground", "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, AcceptedInvite: %u. Player is not invited to any bg!",
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, battlefieldPort.Ticket.Type, battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, uint32(battlefieldPort.Ticket.Type), battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
return;
}
@@ -294,7 +294,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
if (battlefieldPort.AcceptedInvite)
{
TC_LOG_DEBUG("bg.battleground", "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, AcceptedInvite: %u. Cant find BG with id %u!",
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, battlefieldPort.Ticket.Type, battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite), ginfo.IsInvitedToBGInstanceGUID);
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, uint32(battlefieldPort.Ticket.Type), battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite), ginfo.IsInvitedToBGInstanceGUID);
return;
}
@@ -307,7 +307,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
}
TC_LOG_DEBUG("bg.battleground", "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, AcceptedInvite: %u.",
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, battlefieldPort.Ticket.Type, battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
GetPlayerInfo().c_str(), battlefieldPort.Ticket.Id, uint32(battlefieldPort.Ticket.Type), battlefieldPort.Ticket.Time, uint32(battlefieldPort.AcceptedInvite));
// get real bg type
bgTypeId = bg->GetTypeID();

File diff suppressed because it is too large Load Diff

View File

@@ -16,3 +16,392 @@
*/
#include "LFGPackets.h"
void WorldPackets::LFG::DFJoin::Read()
{
QueueAsGroup = _worldPacket.ReadBit();
Unknown = _worldPacket.ReadBit();
_worldPacket >> PartyIndex;
_worldPacket >> Roles;
Slots.resize(_worldPacket.read<uint32>());
for (uint32& slot : Slots)
_worldPacket >> slot;
}
void WorldPackets::LFG::DFLeave::Read()
{
_worldPacket >> Ticket;
}
void WorldPackets::LFG::DFProposalResponse::Read()
{
_worldPacket >> Ticket;
_worldPacket >> InstanceID;
_worldPacket >> InstanceID;
Accepted = _worldPacket.ReadBit();
}
void WorldPackets::LFG::DFSetRoles::Read()
{
_worldPacket >> RolesDesired;
_worldPacket >> PartyIndex;
}
void WorldPackets::LFG::DFBootPlayerVote::Read()
{
Vote = _worldPacket.ReadBit();
}
void WorldPackets::LFG::DFTeleport::Read()
{
TeleportOut = _worldPacket.ReadBit();
}
void WorldPackets::LFG::DFGetSystemInfo::Read()
{
Player = _worldPacket.ReadBit();
_worldPacket >> PartyIndex;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGBlackListSlot const& lfgBlackListSlot)
{
data << uint32(lfgBlackListSlot.Slot);
data << uint32(lfgBlackListSlot.Reason);
data << int32(lfgBlackListSlot.SubReason1);
data << int32(lfgBlackListSlot.SubReason2);
return data;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGBlackList const& blackList)
{
data.WriteBit(blackList.PlayerGuid.is_initialized());
data << uint32(blackList.Slot.size());
if (blackList.PlayerGuid)
data << *blackList.PlayerGuid;
for (WorldPackets::LFG::LFGBlackListSlot const& slot : blackList.Slot)
data << slot;
return data;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgPlayerQuestRewardItem const& playerQuestRewardItem)
{
data << int32(playerQuestRewardItem.ItemID);
data << int32(playerQuestRewardItem.Quantity);
return data;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgPlayerQuestRewardCurrency const& playerQuestRewardCurrency)
{
data << int32(playerQuestRewardCurrency.CurrencyID);
data << int32(playerQuestRewardCurrency.Quantity);
return data;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgPlayerQuestReward const& playerQuestReward)
{
data << uint32(playerQuestReward.Mask);
data << int32(playerQuestReward.RewardMoney);
data << int32(playerQuestReward.RewardXP);
data << uint32(playerQuestReward.Item.size());
data << uint32(playerQuestReward.Currency.size());
data << uint32(playerQuestReward.BonusCurrency.size());
for (WorldPackets::LFG::LfgPlayerQuestRewardItem const& item : playerQuestReward.Item)
data << item;
for (WorldPackets::LFG::LfgPlayerQuestRewardCurrency const& currency : playerQuestReward.Currency)
data << currency;
for (WorldPackets::LFG::LfgPlayerQuestRewardCurrency const& bonusCurrency : playerQuestReward.BonusCurrency)
data << bonusCurrency;
data.WriteBit(playerQuestReward.RewardSpellID.is_initialized());
data.WriteBit(playerQuestReward.Unused1.is_initialized());
data.WriteBit(playerQuestReward.Unused2.is_initialized());
data.WriteBit(playerQuestReward.Honor.is_initialized());
data.FlushBits();
if (playerQuestReward.RewardSpellID)
data << int32(*playerQuestReward.RewardSpellID);
if (playerQuestReward.Unused1)
data << int32(*playerQuestReward.Unused1);
if (playerQuestReward.Unused2)
data << uint64(*playerQuestReward.Unused2);
if (playerQuestReward.Honor)
data << int32(*playerQuestReward.Honor);
return data;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgPlayerDungeonInfo const& playerDungeonInfo)
{
data << uint32(playerDungeonInfo.Slot);
data << int32(playerDungeonInfo.CompletionQuantity);
data << int32(playerDungeonInfo.CompletionLimit);
data << int32(playerDungeonInfo.CompletionCurrencyID);
data << int32(playerDungeonInfo.SpecificQuantity);
data << int32(playerDungeonInfo.SpecificLimit);
data << int32(playerDungeonInfo.OverallQuantity);
data << int32(playerDungeonInfo.OverallLimit);
data << int32(playerDungeonInfo.PurseWeeklyQuantity);
data << int32(playerDungeonInfo.PurseWeeklyLimit);
data << int32(playerDungeonInfo.PurseQuantity);
data << int32(playerDungeonInfo.PurseLimit);
data << int32(playerDungeonInfo.Quantity);
data << uint32(playerDungeonInfo.CompletedMask);
data << uint32(playerDungeonInfo.EncounterMask);
data << uint32(playerDungeonInfo.ShortageReward.size());
data.WriteBit(playerDungeonInfo.FirstReward);
data.WriteBit(playerDungeonInfo.ShortageEligible);
data.FlushBits();
data << playerDungeonInfo.Rewards;
for (WorldPackets::LFG::LfgPlayerQuestReward const& shortageReward : playerDungeonInfo.ShortageReward)
data << shortageReward;
return data;
}
WorldPacket const* WorldPackets::LFG::LfgPlayerInfo::Write()
{
_worldPacket << uint32(Dungeon.size());
_worldPacket << BlackList;
for (LfgPlayerDungeonInfo const& playerDungeonInfo : Dungeon)
_worldPacket << playerDungeonInfo;
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LfgPartyInfo::Write()
{
_worldPacket << uint32(Player.size());
for (WorldPackets::LFG::LFGBlackList const& player : Player)
_worldPacket << player;
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LFGUpdateStatus::Write()
{
_worldPacket << Ticket;
_worldPacket << uint8(SubType);
_worldPacket << uint8(Reason);
_worldPacket << uint32(Slots.size());
_worldPacket << uint32(RequestedRoles);
_worldPacket << uint32(SuspendedPlayers.size());
for (uint32 slot : Slots)
_worldPacket << uint32(slot);
for (ObjectGuid const& suspendedPlayer : SuspendedPlayers)
_worldPacket << suspendedPlayer;
_worldPacket.WriteBit(IsParty);
_worldPacket.WriteBit(NotifyUI);
_worldPacket.WriteBit(Joined);
_worldPacket.WriteBit(LfgJoined);
_worldPacket.WriteBit(Queued);
_worldPacket.WriteBit(Unused);
_worldPacket.FlushBits();
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::RoleChosen::Write()
{
_worldPacket << Player;
_worldPacket << uint32(RoleMask);
_worldPacket.WriteBit(Accepted);
_worldPacket.FlushBits();
return &_worldPacket;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGRoleCheckUpdateMember const& lfgRoleCheckUpdateMember)
{
data << lfgRoleCheckUpdateMember.Guid;
data << uint32(lfgRoleCheckUpdateMember.RolesDesired);
data << uint8(lfgRoleCheckUpdateMember.Level);
data.WriteBit(lfgRoleCheckUpdateMember.RoleCheckComplete);
data.FlushBits();
return data;
}
WorldPacket const* WorldPackets::LFG::LFGRoleCheckUpdate::Write()
{
_worldPacket << uint8(PartyIndex);
_worldPacket << uint8(RoleCheckStatus);
_worldPacket << uint32(JoinSlots.size());
_worldPacket << uint64(BgQueueID);
_worldPacket << int32(GroupFinderActivityID);
_worldPacket << uint32(Members.size());
for (uint32 slot : JoinSlots)
_worldPacket << uint32(slot);
_worldPacket.WriteBit(IsBeginning);
_worldPacket.WriteBit(IsRequeue);
_worldPacket.FlushBits();
for (LFGRoleCheckUpdateMember const& member : Members)
_worldPacket << member;
return &_worldPacket;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGJoinBlackListSlot const& lfgBlackListSlot)
{
data << int32(lfgBlackListSlot.Slot);
data << int32(lfgBlackListSlot.Reason);
data << int32(lfgBlackListSlot.SubReason1);
data << int32(lfgBlackListSlot.SubReason2);
return data;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGJoinBlackList const& blackList)
{
data << blackList.Guid;
data << uint32(blackList.Slots.size());
for (WorldPackets::LFG::LFGJoinBlackListSlot const& slot : blackList.Slots)
data << slot;
return data;
}
WorldPacket const* WorldPackets::LFG::LFGJoinResult::Write()
{
_worldPacket << Ticket;
_worldPacket << uint8(Result);
_worldPacket << uint8(ResultDetail);
_worldPacket << uint32(BlackList.size());
for (LFGJoinBlackList const& blackList : BlackList)
_worldPacket << blackList;
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LFGQueueStatus::Write()
{
_worldPacket << Ticket;
_worldPacket << uint32(Slot);
_worldPacket << uint32(AvgWaitTimeMe);
_worldPacket << uint32(AvgWaitTime);
for (uint32 i = 0; i < 3; ++i)
{
_worldPacket << uint32(AvgWaitTimeByRole[i]);
_worldPacket << uint8(LastNeeded[i]);
}
_worldPacket << uint32(QueuedTime);
return &_worldPacket;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGPlayerRewards const& lfgPlayerRewards)
{
data << int32(lfgPlayerRewards.RewardItem);
data << uint32(lfgPlayerRewards.RewardItemQuantity);
data << int32(lfgPlayerRewards.BonusCurrency);
data.WriteBit(lfgPlayerRewards.IsCurrency);
return data;
}
WorldPacket const* WorldPackets::LFG::LFGPlayerReward::Write()
{
_worldPacket << uint32(QueuedSlot);
_worldPacket << uint32(ActualSlot);
_worldPacket << int32(RewardMoney);
_worldPacket << int32(AddedXP);
_worldPacket << uint32(Rewards.size());
for (LFGPlayerRewards const& reward : Rewards)
_worldPacket << reward;
return &_worldPacket;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LfgBootInfo const& lfgBootInfo)
{
data.WriteBit(lfgBootInfo.VoteInProgress);
data.WriteBit(lfgBootInfo.VotePassed);
data.WriteBit(lfgBootInfo.MyVoteCompleted);
data.WriteBit(lfgBootInfo.MyVote);
data.WriteBits(lfgBootInfo.Reason.length(), 8);
data << lfgBootInfo.Target;
data << uint32(lfgBootInfo.TotalVotes);
data << uint32(lfgBootInfo.BootVotes);
data << int32(lfgBootInfo.TimeLeft);
data << uint32(lfgBootInfo.VotesNeeded);
data.WriteString(lfgBootInfo.Reason);
return data;
}
WorldPacket const* WorldPackets::LFG::LfgBootPlayer::Write()
{
_worldPacket << Info;
return &_worldPacket;
}
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::LFGProposalUpdatePlayer const& lfgProposalUpdatePlayer)
{
data << uint32(lfgProposalUpdatePlayer.Roles);
data.WriteBit(lfgProposalUpdatePlayer.Me);
data.WriteBit(lfgProposalUpdatePlayer.SameParty);
data.WriteBit(lfgProposalUpdatePlayer.MyParty);
data.WriteBit(lfgProposalUpdatePlayer.Responded);
data.WriteBit(lfgProposalUpdatePlayer.Accepted);
data.FlushBits();
return data;
}
WorldPacket const* WorldPackets::LFG::LFGProposalUpdate::Write()
{
_worldPacket << Ticket;
_worldPacket << uint64(InstanceID);
_worldPacket << uint32(ProposalID);
_worldPacket << uint32(Slot);
_worldPacket << int8(State);
_worldPacket << uint32(CompletedMask);
_worldPacket << uint32(Players.size());
_worldPacket << uint8(Unused);
_worldPacket.WriteBit(ValidCompletedMask);
_worldPacket.WriteBit(ProposalSilent);
_worldPacket.WriteBit(IsRequeue);
_worldPacket.FlushBits();
for (LFGProposalUpdatePlayer const& player : Players)
_worldPacket << player;
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LFGOfferContinue::Write()
{
_worldPacket << uint32(Slot);
return &_worldPacket;
}
WorldPacket const* WorldPackets::LFG::LFGTeleportDenied::Write()
{
_worldPacket.WriteBits(Reason, 4);
_worldPacket.FlushBits();
return &_worldPacket;
}

View File

@@ -20,11 +20,414 @@
#include "Packet.h"
#include "LFGPacketsCommon.h"
#include "Optional.h"
namespace lfg
{
enum LfgTeleportResult : uint8;
}
namespace WorldPackets
{
namespace LFG
{
class DFJoin final : public ClientPacket
{
public:
DFJoin(WorldPacket&& packet) : ClientPacket(CMSG_DF_JOIN, std::move(packet)) { }
void Read() override;
bool QueueAsGroup = false;
bool Unknown = false; // Always false in 7.2.5
uint8 PartyIndex = 0;
uint32 Roles = 0;
Array<uint32, 50> Slots;
};
class DFLeave final : public ClientPacket
{
public:
DFLeave(WorldPacket&& packet) : ClientPacket(CMSG_DF_LEAVE, std::move(packet)) { }
void Read() override;
RideTicket Ticket;
};
class DFProposalResponse final : public ClientPacket
{
public:
DFProposalResponse(WorldPacket&& packet) : ClientPacket(CMSG_DF_PROPOSAL_RESPONSE, std::move(packet)) { }
void Read() override;
RideTicket Ticket;
uint64 InstanceID = 0;
uint32 ProposalID = 0;
bool Accepted = false;
};
class DFSetRoles final : public ClientPacket
{
public:
DFSetRoles(WorldPacket&& packet) : ClientPacket(CMSG_DF_SET_ROLES, std::move(packet)) { }
void Read() override;
uint32 RolesDesired = 0;
uint8 PartyIndex = 0;
};
class DFBootPlayerVote final : public ClientPacket
{
public:
DFBootPlayerVote(WorldPacket&& packet) : ClientPacket(CMSG_DF_BOOT_PLAYER_VOTE, std::move(packet)) { }
void Read() override;
bool Vote = false;
};
class DFTeleport final : public ClientPacket
{
public:
DFTeleport(WorldPacket&& packet) : ClientPacket(CMSG_DF_TELEPORT, std::move(packet)) { }
void Read() override;
bool TeleportOut = false;
};
class DFGetSystemInfo final : public ClientPacket
{
public:
DFGetSystemInfo(WorldPacket&& packet) : ClientPacket(CMSG_DF_GET_SYSTEM_INFO, std::move(packet)) { }
void Read() override;
uint8 PartyIndex = 0;
bool Player = false;
};
class DFGetJoinStatus final : public ClientPacket
{
public:
DFGetJoinStatus(WorldPacket&& packet) : ClientPacket(CMSG_DF_GET_JOIN_STATUS, std::move(packet)) { }
void Read() override { }
};
struct LFGBlackListSlot
{
LFGBlackListSlot() { }
LFGBlackListSlot(uint32 slot, uint32 reason, int32 subReason1, int32 subReason2)
: Slot(slot), Reason(reason), SubReason1(subReason1), SubReason2(subReason2) { }
uint32 Slot = 0;
uint32 Reason = 0;
int32 SubReason1 = 0;
int32 SubReason2 = 0;
};
struct LFGBlackList
{
Optional<ObjectGuid> PlayerGuid;
std::vector<LFGBlackListSlot> Slot;
};
struct LfgPlayerQuestRewardItem
{
LfgPlayerQuestRewardItem() { }
LfgPlayerQuestRewardItem(int32 itemId, int32 quantity) : ItemID(itemId), Quantity(quantity) { }
int32 ItemID = 0;
int32 Quantity = 0;
};
struct LfgPlayerQuestRewardCurrency
{
LfgPlayerQuestRewardCurrency() { }
LfgPlayerQuestRewardCurrency(int32 currencyID, int32 quantity) : CurrencyID(currencyID), Quantity(quantity) { }
int32 CurrencyID = 0;
int32 Quantity = 0;
};
struct LfgPlayerQuestReward
{
uint32 Mask = 0; // Roles required for this reward, only used by ShortageReward in SMSG_LFG_PLAYER_INFO
int32 RewardMoney = 0; // Only used by SMSG_LFG_PLAYER_INFO
int32 RewardXP = 0;
std::vector<LfgPlayerQuestRewardItem> Item;
std::vector<LfgPlayerQuestRewardCurrency> Currency; // Only used by SMSG_LFG_PLAYER_INFO
std::vector<LfgPlayerQuestRewardCurrency> BonusCurrency; // Only used by SMSG_LFG_PLAYER_INFO
Optional<int32> RewardSpellID; // Only used by SMSG_LFG_PLAYER_INFO
Optional<int32> Unused1;
Optional<uint64> Unused2;
Optional<int32> Honor; // Only used by SMSG_REQUEST_PVP_REWARDS_RESPONSE
};
struct LfgPlayerDungeonInfo
{
uint32 Slot = 0;
int32 CompletionQuantity = 0;
int32 CompletionLimit = 0;
int32 CompletionCurrencyID = 0;
int32 SpecificQuantity = 0;
int32 SpecificLimit = 0;
int32 OverallQuantity = 0;
int32 OverallLimit = 0;
int32 PurseWeeklyQuantity = 0;
int32 PurseWeeklyLimit = 0;
int32 PurseQuantity = 0;
int32 PurseLimit = 0;
int32 Quantity = 0;
uint32 CompletedMask = 0;
uint32 EncounterMask = 0;
bool FirstReward = false;
bool ShortageEligible = false;
LfgPlayerQuestReward Rewards;
std::vector<LfgPlayerQuestReward> ShortageReward;
};
class LfgPlayerInfo final : public ServerPacket
{
public:
LfgPlayerInfo() : ServerPacket(SMSG_LFG_PLAYER_INFO) { }
WorldPacket const* Write() override;
LFGBlackList BlackList;
std::vector<LfgPlayerDungeonInfo> Dungeon;
};
class LfgPartyInfo final : public ServerPacket
{
public:
LfgPartyInfo() : ServerPacket(SMSG_LFG_PARTY_INFO) { }
WorldPacket const* Write() override;
std::vector<LFGBlackList> Player;
};
class LFGUpdateStatus final : public ServerPacket
{
public:
LFGUpdateStatus() : ServerPacket(SMSG_LFG_UPDATE_STATUS) { }
WorldPacket const* Write() override;
RideTicket Ticket;
uint8 SubType = 0;
uint8 Reason = 0;
std::vector<uint32> Slots;
uint32 RequestedRoles = 0;
std::vector<ObjectGuid> SuspendedPlayers;
bool NotifyUI = false;
bool IsParty = false;
bool Joined = false;
bool LfgJoined = false;
bool Queued = false;
bool Unused = false;
};
class RoleChosen final : public ServerPacket
{
public:
RoleChosen() : ServerPacket(SMSG_ROLE_CHOSEN, 16 + 4 + 1) { }
WorldPacket const* Write() override;
ObjectGuid Player;
uint32 RoleMask = 0;
bool Accepted = false;
};
struct LFGRoleCheckUpdateMember
{
LFGRoleCheckUpdateMember() { }
LFGRoleCheckUpdateMember(ObjectGuid guid, uint32 rolesDesired, uint8 level, bool roleCheckComplete)
: Guid(guid), RolesDesired(rolesDesired), Level(level), RoleCheckComplete(roleCheckComplete) { }
ObjectGuid Guid;
uint32 RolesDesired = 0;
uint8 Level = 0;
bool RoleCheckComplete = false;
};
class LFGRoleCheckUpdate final : public ServerPacket
{
public:
LFGRoleCheckUpdate() : ServerPacket(SMSG_LFG_ROLE_CHECK_UPDATE) { }
WorldPacket const* Write() override;
uint8 PartyIndex = 0;
uint8 RoleCheckStatus = 0;
std::vector<uint32> JoinSlots;
uint64 BgQueueID = 0;
int32 GroupFinderActivityID = 0;
std::vector<LFGRoleCheckUpdateMember> Members;
bool IsBeginning = false;
bool IsRequeue = false;
};
struct LFGJoinBlackListSlot
{
LFGJoinBlackListSlot() { }
LFGJoinBlackListSlot(int32 slot, int32 reason, int32 subReason1, int32 subReason2)
: Slot(slot), Reason(reason), SubReason1(subReason1), SubReason2(subReason2) { }
int32 Slot = 0;
int32 Reason = 0;
int32 SubReason1 = 0;
int32 SubReason2 = 0;
};
struct LFGJoinBlackList
{
ObjectGuid Guid;
std::vector<LFGJoinBlackListSlot> Slots;
};
class LFGJoinResult final : public ServerPacket
{
public:
LFGJoinResult() : ServerPacket(SMSG_LFG_JOIN_RESULT) { }
WorldPacket const* Write() override;
RideTicket Ticket;
uint8 Result = 0;
uint8 ResultDetail = 0;
std::vector<LFGJoinBlackList> BlackList;
};
class LFGQueueStatus final : public ServerPacket
{
public:
LFGQueueStatus() : ServerPacket(SMSG_LFG_QUEUE_STATUS, 16 + 4 + 4 + 4 + 4 + 4 + 4 + 4 * 3 + 3 + 4) { }
WorldPacket const* Write() override;
RideTicket Ticket;
uint32 Slot = 0;
uint32 AvgWaitTimeMe = 0;
uint32 AvgWaitTime = 0;
uint32 AvgWaitTimeByRole[3] = {};
uint8 LastNeeded[3] = {};
uint32 QueuedTime = 0;
};
struct LFGPlayerRewards
{
LFGPlayerRewards() { }
LFGPlayerRewards(int32 rewardItem, uint32 rewardItemQuantity, int32 bonusCurrency, bool isCurrency)
: RewardItem(rewardItem), RewardItemQuantity(rewardItemQuantity), BonusCurrency(bonusCurrency), IsCurrency(isCurrency) { }
int32 RewardItem = 0;
uint32 RewardItemQuantity = 0;
int32 BonusCurrency = 0;
bool IsCurrency = false;
};
class LFGPlayerReward final : public ServerPacket
{
public:
LFGPlayerReward() : ServerPacket(SMSG_LFG_PLAYER_REWARD) { }
WorldPacket const* Write() override;
uint32 QueuedSlot = 0;
uint32 ActualSlot = 0;
int32 RewardMoney = 0;
int32 AddedXP = 0;
std::vector<LFGPlayerRewards> Rewards;
};
struct LfgBootInfo
{
bool VoteInProgress = false;
bool VotePassed = false;
bool MyVoteCompleted = false;
bool MyVote = false;
ObjectGuid Target;
uint32 TotalVotes = 0;
uint32 BootVotes = 0;
int32 TimeLeft = 0;
uint32 VotesNeeded = 0;
std::string Reason;
};
class LfgBootPlayer final : public ServerPacket
{
public:
LfgBootPlayer() : ServerPacket(SMSG_LFG_BOOT_PLAYER) { }
WorldPacket const* Write() override;
LfgBootInfo Info;
};
struct LFGProposalUpdatePlayer
{
uint32 Roles = 0;
bool Me = false;
bool SameParty = false;
bool MyParty = false;
bool Responded = false;
bool Accepted = false;
};
class LFGProposalUpdate final : public ServerPacket
{
public:
LFGProposalUpdate() : ServerPacket(SMSG_LFG_PROPOSAL_UPDATE) { }
WorldPacket const* Write() override;
RideTicket Ticket;
uint64 InstanceID = 0;
uint32 ProposalID = 0;
uint32 Slot = 0;
int8 State = 0;
uint32 CompletedMask = 0;
uint8 Unused;
bool ValidCompletedMask = false;
bool ProposalSilent = false;
bool IsRequeue;
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, 1), Reason(reason) { }
WorldPacket const* Write() override;
lfg::LfgTeleportResult Reason;
};
}
}

View File

@@ -21,7 +21,7 @@ ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::LFG::RideTicket& ticket)
{
data >> ticket.RequesterGuid;
data >> ticket.Id;
data >> ticket.Type;
ticket.Type = data.read<WorldPackets::LFG::RideType>();
data >> ticket.Time;
return data;
@@ -30,9 +30,9 @@ ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::LFG::RideTicket& ticket)
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::LFG::RideTicket const& ticket)
{
data << ticket.RequesterGuid;
data << int32(ticket.Id);
data << int32(ticket.Type);
data << uint32(ticket.Time);
data << uint32(ticket.Id);
data << uint32(ticket.Type);
data << int32(ticket.Time);
return data;
}

View File

@@ -25,12 +25,19 @@ namespace WorldPackets
{
namespace LFG
{
enum class RideType : uint32
{
None = 0,
Battlegrounds = 1,
Lfg = 2
};
struct RideTicket
{
ObjectGuid RequesterGuid;
int32 Id = 0;
int32 Type = 0;
uint32 Time = 0;
uint32 Id = 0;
RideType Type = RideType::None;
int32 Time = 0;
};
}
}

View File

@@ -352,15 +352,15 @@ void OpcodeTable::Initialize()
DEFINE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode);
DEFINE_HANDLER(CMSG_DEPOSIT_REAGENT_BANK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL);
DEFINE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode);
DEFINE_HANDLER(CMSG_DF_BOOT_PLAYER_VOTE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode);
DEFINE_HANDLER(CMSG_DF_BOOT_PLAYER_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode);
DEFINE_HANDLER(CMSG_DF_GET_JOIN_STATUS, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleDFGetJoinStatus);
DEFINE_HANDLER(CMSG_DF_GET_SYSTEM_INFO, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleDFGetSystemInfo);
DEFINE_HANDLER(CMSG_DF_JOIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode);
DEFINE_HANDLER(CMSG_DF_LEAVE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode);
DEFINE_HANDLER(CMSG_DF_PROPOSAL_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode);
DEFINE_HANDLER(CMSG_DF_READY_CHECK_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL);
DEFINE_HANDLER(CMSG_DF_SET_ROLES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode);
DEFINE_HANDLER(CMSG_DF_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode);
DEFINE_HANDLER(CMSG_DF_GET_SYSTEM_INFO, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleDFGetSystemInfo);
DEFINE_HANDLER(CMSG_DF_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode);
DEFINE_HANDLER(CMSG_DF_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode);
DEFINE_HANDLER(CMSG_DF_PROPOSAL_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode);
DEFINE_HANDLER(CMSG_DF_READY_CHECK_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL);
DEFINE_HANDLER(CMSG_DF_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode);
DEFINE_HANDLER(CMSG_DF_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode);
DEFINE_HANDLER(CMSG_DISCARDED_TIME_SYNC_ACKS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL);
DEFINE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter);
DEFINE_HANDLER(CMSG_DO_MASTER_LOOT_ROLL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL);
@@ -1313,28 +1313,27 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEARN_TALENTS_FAILED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEVEL_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEVEL_UP_INFO, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_BOOT_PLAYER, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_BOOT_PLAYER, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_INSTANCE_SHUTDOWN_COUNTDOWN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_LIST_JOIN_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_LIST_SEARCH_RESULTS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_LIST_SEARCH_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_LIST_UPDATE_BLACKLIST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_LIST_UPDATE_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_READY_CHECK_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_READY_CHECK_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
//DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_SEARCH_RESULTS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_CHANGED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, CONNECTION_TYPE_REALM);
@@ -1634,7 +1633,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ROLE_CHANGED_INFORM, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ROLE_CHOSEN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ROLE_CHOSEN, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ROLE_POLL_INFORM, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_RUNE_REGEN_DEBUG, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCENARIO_BOOT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);

View File

@@ -64,6 +64,7 @@ struct LfgQueueStatusData;
struct LfgPlayerRewardData;
struct LfgRoleCheck;
struct LfgUpdateData;
enum LfgTeleportResult : uint8;
}
namespace rbac
@@ -399,6 +400,18 @@ namespace WorldPackets
struct ItemInstance;
}
namespace LFG
{
class DFJoin;
class DFLeave;
class DFProposalResponse;
class DFSetRoles;
class DFBootPlayerVote;
class DFTeleport;
class DFGetSystemInfo;
class DFGetJoinStatus;
}
namespace Loot
{
class LootUnit;
@@ -1527,21 +1540,20 @@ class TC_GAME_API WorldSession
void HandleInstanceLockResponse(WorldPackets::Instance::InstanceLockResponse& packet);
// Looking for Dungeon/Raid
void HandleDFGetSystemInfo(WorldPacket& recvData);
void SendLfgPlayerLockInfo();
void SendLfgPartyLockInfo();
void HandleLfgJoinOpcode(WorldPacket& recvData);
void HandleLfgLeaveOpcode(WorldPacket& recvData);
void HandleLfgSetRolesOpcode(WorldPacket& recvData);
void HandleLfgProposalResultOpcode(WorldPacket& recvData);
void HandleLfgSetBootVoteOpcode(WorldPacket& recvData);
void HandleLfgTeleportOpcode(WorldPacket& recvData);
void HandleDFGetJoinStatus(WorldPacket& recvData);
void HandleLfgJoinOpcode(WorldPackets::LFG::DFJoin& dfJoin);
void HandleLfgLeaveOpcode(WorldPackets::LFG::DFLeave& dfLeave);
void HandleLfgProposalResultOpcode(WorldPackets::LFG::DFProposalResponse& dfProposalResponse);
void HandleLfgSetRolesOpcode(WorldPackets::LFG::DFSetRoles& dfSetRoles);
void HandleLfgSetBootVoteOpcode(WorldPackets::LFG::DFBootPlayerVote& dfBootPlayerVote);
void HandleLfgTeleportOpcode(WorldPackets::LFG::DFTeleport& dfTeleport);
void HandleDFGetSystemInfo(WorldPackets::LFG::DFGetSystemInfo& dfGetSystemInfo);
void HandleDFGetJoinStatus(WorldPackets::LFG::DFGetJoinStatus& dfGetJoinStatus);
void SendLfgUpdateStatus(lfg::LfgUpdateData const& updateData, bool party);
void SendLfgRoleChosen(ObjectGuid guid, uint8 roles);
void SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& pRoleCheck);
void SendLfgLfrList(bool update);
void SendLfgJoinResult(lfg::LfgJoinResultData const& joinData);
void SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData);
void SendLfgPlayerReward(lfg::LfgPlayerRewardData const& lfgPlayerRewardData);
@@ -1549,7 +1561,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);
void HandleSelfResOpcode(WorldPackets::Spells::SelfRes& packet);
void HandleRequestPetInfo(WorldPackets::Pet::RequestPetInfo& packet);