Merge branch 'master' into Fix-the-crash-2

This commit is contained in:
天鹭 2025-10-31 08:01:28 +08:00 committed by GitHub
commit 20cd7b86c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
57 changed files with 236 additions and 236 deletions

View File

@ -135,6 +135,6 @@ void TotemAI::AttackStart(Unit* /*victim*/)
data << me->GetGUID();
data << me->GetPositionX();
data << me->GetPositionY();
me->GetOwner()->ToPlayer()->GetSession()->SendPacket(&data);
me->GetOwner()->ToPlayer()->SendDirectMessage(&data);
}
}

View File

@ -2378,7 +2378,7 @@ void AchievementMgr::SendAllAchievementData() const
{
WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, _completedAchievements.size() * 8 + 4 + _criteriaProgress.size() * 38 + 4);
BuildAllDataPacket(&data);
GetPlayer()->GetSession()->SendPacket(&data);
GetPlayer()->SendDirectMessage(&data);
}
void AchievementMgr::SendRespondInspectAchievements(Player* player) const
@ -2386,7 +2386,7 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player) const
WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 9 + _completedAchievements.size() * 8 + 4 + _criteriaProgress.size() * 38 + 4);
data << GetPlayer()->GetPackGUID();
BuildAllDataPacket(&data);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
/**

View File

@ -306,7 +306,7 @@ AC_GAME_API void ArenaSpectator::SendPacketTo(Player const* player, std::string&
{
WorldPacket data;
CreatePacket(data, message);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
template<>

View File

@ -354,7 +354,7 @@ void AuctionHouseSearcher::Update()
{
Player* player = ObjectAccessor::FindConnectedPlayer(response->playerGuid);
if (player)
player->GetSession()->SendPacket(&response->packet);
player->SendDirectMessage(&response->packet);
delete response;
}

View File

@ -203,6 +203,6 @@ void AutobroadcastMgr::SendNotificationAnnouncement(uint8 textId)
data << localizedMessage;
// Send packet to the player
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
});
}

View File

@ -458,7 +458,7 @@ void Battlefield::BroadcastPacketToZone(WorldPacket const* data) const
for (uint8 team = 0; team < PVP_TEAMS_COUNT; ++team)
for (GuidUnorderedSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->GetSession()->SendPacket(data);
player->SendDirectMessage(data);
}
void Battlefield::BroadcastPacketToQueue(WorldPacket const* data) const
@ -466,7 +466,7 @@ void Battlefield::BroadcastPacketToQueue(WorldPacket const* data) const
for (uint8 team = 0; team < PVP_TEAMS_COUNT; ++team)
for (GuidUnorderedSet::const_iterator itr = m_PlayersInQueue[team].begin(); itr != m_PlayersInQueue[team].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->GetSession()->SendPacket(data);
player->SendDirectMessage(data);
}
void Battlefield::BroadcastPacketToWar(WorldPacket const* data) const
@ -474,7 +474,7 @@ void Battlefield::BroadcastPacketToWar(WorldPacket const* data) const
for (uint8 team = 0; team < PVP_TEAMS_COUNT; ++team)
for (GuidUnorderedSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->GetSession()->SendPacket(data);
player->SendDirectMessage(data);
}
void Battlefield::SendWarning(uint8 id, WorldObject const* target /*= nullptr*/)
@ -663,7 +663,7 @@ void Battlefield::SendAreaSpiritHealerQueryOpcode(Player* player, const ObjectGu
data << guid << time;
ASSERT(player);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
// ----------------------

View File

@ -349,7 +349,7 @@ void ArenaTeam::DelMember(ObjectGuid guid, bool cleanDb)
playerMember->RemoveBattlegroundQueueId(bgQueue);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, nullptr, playerMember->GetBattlegroundQueueIndex(bgQueue), STATUS_NONE, 0, 0, 0, TEAM_NEUTRAL);
queue.RemovePlayer(playerMember->GetGUID(), true);
playerMember->GetSession()->SendPacket(&data);
playerMember->SendDirectMessage(&data);
}
}
}
@ -567,7 +567,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket* packet)
{
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
if (Player* player = ObjectAccessor::FindConnectedPlayer(itr->Guid))
player->GetSession()->SendPacket(packet);
player->SendDirectMessage(packet);
}
void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3)

View File

@ -608,7 +608,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
{
WorldPacket status;
sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player->GetCurrentBattlegroundQueueSlot(), STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), player->GetBgTeamId());
player->GetSession()->SendPacket(&status);
player->SendDirectMessage(&status);
player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
player->ResetAllPowers();
@ -652,7 +652,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
data << t->GetGUID();
data << uint32(t->GetZoneId());
data << uint32(15 * IN_MILLISECONDS);
p->GetSession()->SendPacket(&data);
p->SendDirectMessage(&data);
}
m_ToBeTeleported.clear();
}
@ -713,14 +713,14 @@ Position const* Battleground::GetTeamStartPosition(TeamId teamId) const
void Battleground::SendPacketToAll(WorldPacket const* packet)
{
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
itr->second->GetSession()->SendPacket(packet);
itr->second->SendDirectMessage(packet);
}
void Battleground::SendPacketToTeam(TeamId teamId, WorldPacket const* packet, Player* sender, bool self)
{
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (itr->second->GetBgTeamId() == teamId && (self || sender != itr->second))
itr->second->GetSession()->SendPacket(packet);
itr->second->SendDirectMessage(packet);
}
void Battleground::SendChatMessage(Creature* source, uint8 textId, WorldObject* target /*= nullptr*/)
@ -937,7 +937,7 @@ void Battleground::EndBattleground(PvPTeamId winnerTeamId)
BlockMovement(player);
player->GetSession()->SendPacket(&pvpLogData);
player->SendDirectMessage(&pvpLogData);
if (isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
{
@ -964,7 +964,7 @@ void Battleground::EndBattleground(PvPTeamId winnerTeamId)
WorldPacket data;
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetCurrentBattlegroundQueueSlot(), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType(), player->GetBgTeamId());
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, player->GetMapId());
}
@ -1062,7 +1062,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
WorldPacket data;
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetCurrentBattlegroundQueueSlot(), STATUS_NONE, 0, 0, 0, TEAM_NEUTRAL);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetBgTypeID(), GetArenaType());
@ -1341,7 +1341,7 @@ bool Battleground::HasFreeSlots() const
void Battleground::SpectatorsSendPacket(WorldPacket& data)
{
for (SpectatorList::const_iterator itr = m_Spectators.begin(); itr != m_Spectators.end(); ++itr)
(*itr)->GetSession()->SendPacket(&data);
(*itr)->SendDirectMessage(&data);
}
void Battleground::ReadyMarkerClicked(Player* p)
@ -1813,10 +1813,10 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* player)
BlockMovement(player);
BuildPvPLogDataPacket(data);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetCurrentBattlegroundQueueSlot(), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType(), player->GetBgTeamId());
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
uint32 Battleground::GetAlivePlayersCountByTeam(TeamId teamId) const

View File

@ -670,7 +670,7 @@ void BattlegroundMgr::SendAreaSpiritHealerQueryOpcode(Player* player, Battlegrou
if (time_ == uint32(-1))
time_ = 0;
data << guid << time_;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
bool BattlegroundMgr::IsArenaType(BattlegroundTypeId bgTypeId)

View File

@ -1274,7 +1274,7 @@ void BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg,
// send status packet
WorldPacket data;
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType, TEAM_NEUTRAL, bg->isRated());
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
// pussywizard:
if (bg->isArena() && bg->isRated())
@ -1312,7 +1312,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
// send remaining time in queue
WorldPacket data;
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType, TEAM_NEUTRAL, bg->isRated(), m_BgTypeId);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
}

View File

@ -307,7 +307,7 @@ void BattlegroundSA::StartShips()
WorldPacket pkt;
GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, itr->second);
data.BuildPacket(pkt);
itr->second->GetSession()->SendPacket(&pkt);
itr->second->SendDirectMessage(&pkt);
}
}
ShipsStarted = true;
@ -1141,7 +1141,7 @@ void BattlegroundSA::SendTransportInit(Player* player)
GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player);
WorldPacket packet;
transData.BuildPacket(packet);
player->GetSession()->SendPacket(&packet);
player->SendDirectMessage(&packet);
}
}
@ -1156,7 +1156,7 @@ void BattlegroundSA::SendTransportsRemove(Player* player)
GetBGObject(BG_SA_BOAT_TWO)->BuildOutOfRangeUpdateBlock(&transData);
WorldPacket packet;
transData.BuildPacket(packet);
player->GetSession()->SendPacket(&packet);
player->SendDirectMessage(&packet);
}
}

View File

@ -908,26 +908,26 @@ void Channel::SendToAll(WorldPacket* data, ObjectGuid guid)
{
for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
if (!guid || !i->second.plrPtr->GetSocial()->HasIgnore(guid))
i->second.plrPtr->GetSession()->SendPacket(data);
i->second.plrPtr->SendDirectMessage(data);
}
void Channel::SendToAllButOne(WorldPacket* data, ObjectGuid who)
{
for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
if (i->first != who)
i->second.plrPtr->GetSession()->SendPacket(data);
i->second.plrPtr->SendDirectMessage(data);
}
void Channel::SendToOne(WorldPacket* data, ObjectGuid who)
{
if (Player* player = ObjectAccessor::FindConnectedPlayer(who))
player->GetSession()->SendPacket(data);
player->SendDirectMessage(data);
}
void Channel::SendToAllWatching(WorldPacket* data)
{
for (PlayersWatchingContainer::const_iterator i = playersWatchingStore.begin(); i != playersWatchingStore.end(); ++i)
(*i)->GetSession()->SendPacket(data);
(*i)->SendDirectMessage(data);
}
bool Channel::ShouldAnnouncePlayer(Player const* player) const

View File

@ -150,7 +150,7 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
{
WorldPacket data;
MakeNotOnPacket(&data, name);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
return nullptr;

View File

@ -961,7 +961,7 @@ namespace lfg
RBCacheMap::iterator itr = RBCacheStore[player->GetTeamId()].find(dungeonId);
if (itr != RBCacheStore[player->GetTeamId()].end())
{
player->GetSession()->SendPacket(&(itr->second));
player->SendDirectMessage(&(itr->second));
return;
}
// send empty packet if cache not found
@ -973,7 +973,7 @@ namespace lfg
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void LFGMgr::UpdateRaidBrowser(uint32 diff)
@ -1220,7 +1220,7 @@ namespace lfg
for (RBSearchersMap::const_iterator sitr = RBSearchersStore[team].begin(); sitr != RBSearchersStore[team].end(); ++sitr)
if (sitr->second == dungeonId)
if (Player* p = ObjectAccessor::FindConnectedPlayer(sitr->first))
p->GetSession()->SendPacket(&differencePacket);
p->SendDirectMessage(&differencePacket);
break; // one dungeon updated in one LFGMgr::UpdateRaidBrowser
}

View File

@ -517,7 +517,7 @@ void GameObject::Update(uint32 diff)
WorldPacket packet;
BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer());
udata.BuildPacket(packet);
caster->ToPlayer()->GetSession()->SendPacket(&packet);
caster->ToPlayer()->SendDirectMessage(&packet);
SendCustomAnim(GetGoAnimProgress());
}
@ -637,7 +637,7 @@ void GameObject::Update(uint32 diff)
caster->ToPlayer()->RemoveGameObject(this, false);
WorldPacket data(SMSG_FISH_ESCAPED, 0);
caster->ToPlayer()->GetSession()->SendPacket(&data);
caster->ToPlayer()->SendDirectMessage(&data);
}
// can be delete
m_lootState = GO_JUST_DEACTIVATED;
@ -1628,7 +1628,7 @@ void GameObject::Use(Unit* user)
{
WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8);
data << GetGUID();
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
else if (info->goober.gossipID)
{
@ -1798,7 +1798,7 @@ void GameObject::Use(Unit* user)
SetLootState(GO_JUST_DEACTIVATED);
WorldPacket data(SMSG_FISH_NOT_HOOKED, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
break;
}
}
@ -2034,7 +2034,7 @@ void GameObject::Use(Unit* user)
player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR + info->barberChair.chairheight);
return;
@ -2311,7 +2311,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= nullptr*/
data << uint32(-change); // change < 0 triggers SPELL_BUILDING_HEAL combat log event
// change >= 0 triggers SPELL_BUILDING_DAMAGE event
data << uint32(spellId);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
GameObjectDestructibleState newState = GetDestructibleState();

View File

@ -1066,7 +1066,7 @@ void Item::SendUpdateSockets()
for (uint32 i = SOCK_ENCHANTMENT_SLOT; i <= BONUS_ENCHANTMENT_SLOT; ++i)
data << uint32(GetEnchantmentId(EnchantmentSlot(i)));
GetOwner()->GetSession()->SendPacket(&data);
GetOwner()->SendDirectMessage(&data);
}
// Though the client has the information in the item's data field,
@ -1081,7 +1081,7 @@ void Item::SendTimeUpdate(Player* owner)
WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8 + 4));
data << GetGUID();
data << uint32(duration);
owner->GetSession()->SendPacket(&data);
owner->SendDirectMessage(&data);
}
Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clone, uint32 randomPropertyId)

View File

@ -240,7 +240,7 @@ void Object::SendUpdateToPlayer(Player* player)
BuildCreateUpdateBlockForPlayer(&upd, player);
upd.BuildPacket(packet);
player->GetSession()->SendPacket(&packet);
player->SendDirectMessage(&packet);
}
void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target)
@ -272,7 +272,7 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const
{
WorldPacket data(SMSG_ARENA_UNIT_DESTROYED, 8);
data << GetGUID();
target->GetSession()->SendPacket(&data);
target->SendDirectMessage(&data);
}
}
}
@ -282,7 +282,7 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const
//! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object.
//! OnDeath() does for eg trigger death animation and interrupts certain spells/missiles/auras/sounds...
data << uint8(onDeath ? 1 : 0);
target->GetSession()->SendPacket(&data);
target->SendDirectMessage(&data);
}
[[nodiscard]] int32 Object::GetInt32Value(uint16 index) const
@ -2065,7 +2065,7 @@ void WorldObject::SendPlayMusic(uint32 Music, bool OnlySelf)
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << Music;
if (OnlySelf && IsPlayer())
this->ToPlayer()->GetSession()->SendPacket(&data);
ToPlayer()->SendDirectMessage(&data);
else
SendMessageToSet(&data, true); // ToSelf ignored in this case
}

View File

@ -1512,7 +1512,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result)
if (!cooldowns.empty() && GetOwner())
{
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, cooldowns);
GetOwner()->GetSession()->SendPacket(&data);
GetOwner()->SendDirectMessage(&data);
}
}
}

View File

@ -1342,7 +1342,7 @@ void Player::SendTeleportAckPacket()
data << GetPackGUID();
data << GetSession()->GetOrderCounter(); // movement counter
BuildMovementPacket(&data);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
GetSession()->IncrementOrderCounter();
}
@ -1559,7 +1559,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (m_transport)
data << m_transport->GetEntry() << GetMapId();
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
// remove from old map now
@ -1581,7 +1581,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
else
data << teleportStore_dest.PositionXYZOStream();
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
SendSavedInstances();
}
@ -2363,7 +2363,7 @@ void Player::SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool re
}
data << uint8(recruitAFriend ? 1 : 0); // does the GivenXP include a RaF bonus?
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
@ -2840,7 +2840,7 @@ void Player::SendInitialSpells()
data << uint32(itr->second.category ? cooldown : 0); // category cooldown
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::RemoveMail(uint32 id)
@ -2869,7 +2869,7 @@ void Player::SendMailResult(uint32 mailId, MailResponseType mailAction, MailResp
data << (uint32) item_guid; // item guid low?
data << (uint32) item_count; // item count?
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendNewMail()
@ -2877,7 +2877,7 @@ void Player::SendNewMail()
// deliver undelivered mail
WorldPacket data(SMSG_RECEIVED_MAIL, 4);
data << (uint32) 0;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::AddNewMailDeliverTime(time_t deliver_time)
@ -3035,13 +3035,13 @@ void Player::SendLearnPacket(uint32 spellId, bool learn)
WorldPacket data(SMSG_LEARNED_SPELL, 6);
data << uint32(spellId);
data << uint16(0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
else
{
WorldPacket data(SMSG_REMOVED_SPELL, 4);
data << uint32(spellId);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
@ -3073,7 +3073,7 @@ bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool
WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4);
data << uint32(nextSpellInfo->Id);
data << uint32(spellInfo->Id);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
return false;
}
@ -4426,7 +4426,7 @@ void Player::SetMovement(PlayerMovementType pType)
}
data << guid;
data << GetSession()->GetOrderCounter(); // movement counter
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
GetSession()->IncrementOrderCounter();
}
@ -4438,7 +4438,7 @@ void Player::BuildPlayerRepop()
{
WorldPacket data(SMSG_PRE_RESURRECT, GetPackGUID().size());
data << GetPackGUID();
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
if (getRace(true) == RACE_NIGHTELF)
{
CastSpell(this, 20584, true);
@ -4493,7 +4493,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
data << float(0);
data << float(0);
data << float(0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
// speed change, land walk
@ -4980,7 +4980,7 @@ void Player::RepopAtGraveyard()
data << ClosestGrave->x;
data << ClosestGrave->y;
data << ClosestGrave->z;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
else if (GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY()))
@ -5590,7 +5590,7 @@ void Player::SendActionButtons(uint32 state) const
}
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("entities.player", "Action Buttons for {} spec {} Sent", GetGUID().ToString(), m_activeSpec);
}
@ -6217,7 +6217,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
// Xinef: non quest case, quest honor obtain is send in quest reward packet
if (uVictim || groupsize > 0)
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
// add honor points
ModifyHonorPoints(honor);
@ -6410,7 +6410,7 @@ void Player::CheckDuelDistance(time_t currTime)
duel->OutOfBoundsTime = currTime + 10;
WorldPacket data(SMSG_DUEL_OUTOFBOUNDS, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
else
@ -6420,7 +6420,7 @@ void Player::CheckDuelDistance(time_t currTime)
duel->OutOfBoundsTime = 0;
WorldPacket data(SMSG_DUEL_INBOUNDS, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
else if (currTime >= duel->OutOfBoundsTime)
DuelComplete(DUEL_FLED);
@ -7783,7 +7783,7 @@ void Player::SendQuestGiverStatusMultiple()
});
data.put<uint32>(0, count); // write real count
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
/* If in a battleground a player dies, and an enemy removes the insignia, the player's bones is lootable
@ -8230,14 +8230,14 @@ void Player::SendLootError(ObjectGuid guid, LootError error)
void Player::SendNotifyLootMoneyRemoved()
{
WorldPacket data(SMSG_LOOT_CLEAR_MONEY, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendNotifyLootItemRemoved(uint8 lootSlot)
{
WorldPacket data(SMSG_LOOT_REMOVED, 1);
data << uint8(lootSlot);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
// TODO - InitWorldStates should NOT always send the same states
@ -8942,7 +8942,7 @@ void Player::SetBindPoint(ObjectGuid guid)
{
WorldPacket data(SMSG_BINDER_CONFIRM, 8);
data << guid;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendTalentWipeConfirm(ObjectGuid guid)
@ -8951,7 +8951,7 @@ void Player::SendTalentWipeConfirm(ObjectGuid guid)
data << guid;
uint32 cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost();
data << cost;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::ResetPetTalents()
@ -9214,7 +9214,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
{
WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
if (GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_PET);
@ -9501,14 +9501,14 @@ void Player::Whisper(std::string_view text, Language language, Player* target, b
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, language, this, this, _text);
target->GetSession()->SendPacket(&data);
target->SendDirectMessage(&data);
// rest stuff shouldn't happen in case of addon message
if (isAddonMessage)
return;
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER_INFORM, Language(language), target, target, _text);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
if (!isAcceptWhispers() && !IsGameMaster() && !target->IsGameMaster())
{
@ -9617,7 +9617,7 @@ void Player::PetSpellInitialize()
data << uint32(category ? cooldown : 0); // category cooldown
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::PossessSpellInitialize()
@ -9645,7 +9645,7 @@ void Player::PossessSpellInitialize()
data << uint8(0); // spells count
data << uint8(0); // cooldowns count
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::VehicleSpellInitialize()
@ -9720,7 +9720,7 @@ void Player::VehicleSpellInitialize()
data << uint32(category ? cooldown : 0); // category cooldown
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::CharmSpellInitialize()
@ -9774,14 +9774,14 @@ void Player::CharmSpellInitialize()
data << uint8(0); // cooldowns count
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendRemoveControlBar()
{
WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
bool Player::HasSpellMod(SpellModifier* mod, Spell* spell)
@ -10131,7 +10131,7 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask)
{
WorldPacket data(SMSG_SET_PROFICIENCY, 1 + 4);
data << uint8(itemClass) << uint32(itemSubclassMask);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::RemovePetitionsAndSigns(ObjectGuid guid, uint32 type)
@ -10583,7 +10583,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
if (!cooldowns.empty())
{
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, cooldowns);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
@ -10703,7 +10703,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
data << uint32(vendorslot + 1); // numbered from 1 at client
data << int32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF);
data << uint32(count);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
SendNewItem(it, pProto->BuyCount * count, true, false, false);
if (!bStore)
@ -11120,7 +11120,7 @@ void Player::ModifySpellCooldown(uint32 spellId, int32 cooldown)
data << uint32(spellId); // Spell ID
data << GetGUID(); // Player GUID
data << int32(cooldown); // Cooldown mod in milliseconds
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /*= 0*/, Spell* spell /*= nullptr*/, bool setCooldown /*= true*/)
@ -11596,7 +11596,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
data << m_homebindX << m_homebindY << m_homebindZ;
data << (uint32) m_homebindMapId;
data << (uint32) m_homebindAreaId;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
// SMSG_SET_PROFICIENCY
// SMSG_SET_PCT_SPELL_MODIFIER
@ -11609,13 +11609,13 @@ void Player::SendInitialPacketsBeforeAddToMap()
data.Initialize(SMSG_INSTANCE_DIFFICULTY, 4 + 4);
data << uint32(GetMap()->GetDifficulty());
data << uint32(GetMap()->GetEntry()->IsDynamicDifficultyMap() && GetMap()->IsHeroic()); // Raid dynamic difficulty
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
SendInitialSpells();
data.Initialize(SMSG_SEND_UNLEARN_SPELLS, 4);
data << uint32(0); // count, for (count) uint32;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
SendInitialActionButtons();
m_reputationMgr->SendInitialReputations();
@ -11627,7 +11627,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
data.AppendPackedTime(GameTime::GetGameTime().count());
data << float(0.01666667f); // game speed
data << uint32(0); // added in 3.1.2
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
GetReputationMgr().SendForceReactions(); // SMSG_SET_FORCED_REACTIONS
@ -11779,7 +11779,7 @@ void Player::SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8
default:
break;
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool onEnterMap)
@ -11814,7 +11814,7 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3
data << uint8(bind && bind->perm); // is locked
data << uint8(bind && bind->extended); // is extended, ignored if prev field is 0
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::ApplyEquipCooldown(Item* pItem)
@ -11861,7 +11861,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
WorldPacket data(SMSG_ITEM_COOLDOWN, 12);
data << pItem->GetGUID();
data << uint32(spellData.SpellId);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
@ -12133,7 +12133,7 @@ void Player::GetAurasForTarget(Unit* target, bool force /*= false*/)
auraApp->BuildUpdatePacket(data, false);
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SetDailyQuestStatus(uint32 quest_id)
@ -12903,7 +12903,7 @@ void Player::SetClientControl(Unit* target, bool allowMove, bool packetOnly /*=
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, target->GetPackGUID().size() + 1);
data << target->GetPackGUID();
data << uint8((allowMove && !target->HasUnitState(UNIT_STATE_FLEEING | UNIT_STATE_CONFUSED)) ? 1 : 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
// We want to set the packet only
if (packetOnly)
@ -13024,7 +13024,7 @@ void Player::SendCorpseReclaimDelay(uint32 delay)
{
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
data << uint32(delay);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
Player* Player::GetNextRandomRaidMember(float radius)
@ -13251,7 +13251,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
SetSeer(this);
//WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
//GetSession()->SendPacket(&data);
//SendDirectMessage(&data);
}
}
@ -13407,7 +13407,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost)
WorldPacket data(SMSG_TITLE_EARNED, 4 + 4);
data << uint32(title->bit_index);
data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK);
}
@ -13467,7 +13467,7 @@ void Player::ConvertRune(uint8 index, RuneType newType)
WorldPacket data(SMSG_CONVERT_RUNE, 2);
data << uint8(index);
data << uint8(newType);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::ResyncRunes(uint8 count)
@ -13479,14 +13479,14 @@ void Player::ResyncRunes(uint8 count)
data << uint8(GetCurrentRune(i)); // rune type
data << uint8(255 - (GetRuneCooldown(i) * 51)); // passed cooldown time (0-255)
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::AddRunePower(uint8 index)
{
WorldPacket data(SMSG_ADD_RUNE_POWER, 4);
data << uint32(1 << index); // mask (0x00-0x3F probably)
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
static RuneType runeSlotTypes[MAX_RUNES] =
@ -14544,7 +14544,7 @@ void Player::SendTalentsInfoData(bool pet)
BuildPetTalentsInfoData(&data);
else
BuildPlayerTalentsInfoData(&data);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::BuildEnchantmentsInfoData(WorldPacket* data)
@ -14617,7 +14617,7 @@ void Player::SendEquipmentSetList()
++count; // client have limit but it checked at loading and set
}
data.put<uint32>(count_pos, count);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
@ -14655,7 +14655,7 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
WorldPacket data(SMSG_EQUIPMENT_SET_SAVED, 4 + 1);
data << uint32(index);
data.appendPackGUID(eqslot.Guid);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
eqslot.state = old_state == EQUIPMENT_SET_NEW ? EQUIPMENT_SET_NEW : EQUIPMENT_SET_CHANGED;
@ -15466,7 +15466,7 @@ void Player::SendDuelCountdown(uint32 counter)
{
WorldPacket data(SMSG_DUEL_COUNTDOWN, 4);
data << uint32(counter); // seconds
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SetIsSpectator(bool on)
@ -15670,7 +15670,7 @@ void Player::SendRefundInfo(Item* item)
}
data << uint32(0);
data << uint32(GetTotalPlayedTime() - item->GetPlayedTime());
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
bool Player::AddItem(uint32 itemId, uint32 count)
@ -15718,7 +15718,7 @@ void Player::RefundItem(Item* item)
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4);
data << item->GetGUID(); // Guid
data << uint32(10); // Error!
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
return;
}
@ -15759,7 +15759,7 @@ void Player::RefundItem(Item* item)
WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4);
data << item->GetGUID(); // Guid
data << uint32(10); // Error!
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
return;
}
@ -15774,7 +15774,7 @@ void Player::RefundItem(Item* item)
data << uint32(iece->reqitem[i]);
data << uint32(iece->reqitemcount[i]);
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
uint32 moneyRefund = item->GetPaidMoney(); // item-> will be invalidated in DestroyItem

View File

@ -78,7 +78,7 @@ bool Player::CanSpeak() const
void Player::SendAttackSwingNotInRange()
{
WorldPacket data(SMSG_ATTACKSWING_NOTINRANGE, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, ObjectGuid guid)
@ -128,25 +128,25 @@ void Player::Customize(CharacterCustomizeInfo const* customizeInfo, CharacterDat
void Player::SendAttackSwingDeadTarget()
{
WorldPacket data(SMSG_ATTACKSWING_DEADTARGET, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendAttackSwingCantAttack()
{
WorldPacket data(SMSG_ATTACKSWING_CANT_ATTACK, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendAttackSwingCancelAttack()
{
WorldPacket data(SMSG_CANCEL_COMBAT, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendAttackSwingBadFacingAttack()
{
WorldPacket data(SMSG_ATTACKSWING_BADFACING, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendAutoRepeatCancel(Unit* target)
@ -161,7 +161,7 @@ void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
WorldPacket data(SMSG_EXPLORATION_EXPERIENCE, 8);
data << uint32(Area);
data << uint32(Experience);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendDungeonDifficulty(bool IsInGroup)
@ -171,7 +171,7 @@ void Player::SendDungeonDifficulty(bool IsInGroup)
data << (uint32)GetDungeonDifficulty();
data << uint32(val);
data << uint32(IsInGroup);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty)
@ -181,14 +181,14 @@ void Player::SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty)
data << uint32(forcedDifficulty == -1 ? GetRaidDifficulty() : forcedDifficulty);
data << uint32(val);
data << uint32(IsInGroup);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendResetFailedNotify(uint32 mapid)
{
WorldPacket data(SMSG_RESET_FAILED_NOTIFY, 4);
data << uint32(mapid);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
/// Reset all solo instances and optionally send a message on success for each
@ -327,7 +327,7 @@ void Player::SendResetInstanceSuccess(uint32 MapId)
{
WorldPacket data(SMSG_INSTANCE_RESET, 4);
data << uint32(MapId);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId)
@ -340,7 +340,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId)
WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4);
data << uint32(reason);
data << uint32(MapId);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
/*********************************************************/

View File

@ -990,7 +990,7 @@ bool Player::SatisfyQuestLog(bool msg)
if (msg)
{
WorldPacket data(SMSG_QUESTLOG_FULL, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTLOG_FULL");
}
return false;
@ -2349,7 +2349,7 @@ void Player::SendQuestComplete(uint32 quest_id)
{
WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4);
data << uint32(quest_id);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = {}", quest_id);
}
}
@ -2376,7 +2376,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP)
data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
data << uint32(quest->GetBonusTalents()); // bonus talents
data << uint32(quest->GetRewArenaPoints());
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
@ -2386,7 +2386,7 @@ void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
WorldPacket data(SMSG_QUESTGIVER_QUEST_FAILED, 4 + 4);
data << uint32(questId);
data << uint32(reason); // failed reason (valid reasons: 4, 16, 50, 17, 74, other values show default message)
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED");
}
}
@ -2397,7 +2397,7 @@ void Player::SendQuestTimerFailed(uint32 quest_id)
{
WorldPacket data(SMSG_QUESTUPDATE_FAILEDTIMER, 4);
data << uint32(quest_id);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER");
}
}
@ -2406,7 +2406,7 @@ void Player::SendCanTakeQuestResponse(uint32 msg) const
{
WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4);
data << uint32(msg);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID");
}
@ -2426,7 +2426,7 @@ void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver)
data << uint32(quest->GetQuestId());
data << quest->GetTitle();
data << GetGUID();
pReceiver->GetSession()->SendPacket(&data);
pReceiver->SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT");
}
@ -2439,7 +2439,7 @@ void Player::SendPushToPartyResponse(Player const* player, uint8 msg) const
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8 + 1));
data << player->GetGUID();
data << uint8(msg); // valid values: 0-8
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent MSG_QUEST_PUSH_RESULT");
}
}
@ -2450,7 +2450,7 @@ void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/,
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM");
//data << quest->RequiredItemId[item_idx];
//data << count;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, ObjectGuid guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count)
@ -2469,7 +2469,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, ObjectGuid guid,
data << uint32(old_count + add_count);
data << uint32(quest->RequiredNpcOrGoCount[ creatureOrGO_idx ]);
data << guid;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
uint16 log_slot = FindQuestSlot(quest->GetQuestId());
if (log_slot < MAX_QUEST_LOG_SIZE)
@ -2485,7 +2485,7 @@ void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint
data << uint32(quest->GetQuestId());
data << uint32(old_count + add_count);
data << uint32(quest->GetPlayersSlain());
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
uint16 log_slot = FindQuestSlot(quest->GetQuestId());
if (log_slot < MAX_QUEST_LOG_SIZE)

View File

@ -2757,7 +2757,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
WorldPacket data;
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_INCLUDE_GCD, cooldownSpell, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
}
@ -4051,7 +4051,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
break;
}
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param)
@ -4063,7 +4063,7 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32
if (param > 0)
data << uint32(param);
data << uint8(msg);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid, uint32 param)
@ -4075,7 +4075,7 @@ void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid,
if (param > 0)
data << uint32(param);
data << uint8(msg);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::TradeCancel(bool sendback, TradeStatus status /*= TRADE_STATUS_TRADE_CANCELED*/)
@ -4770,7 +4770,7 @@ void Player::SendNewItem(Item* item, uint32 count, bool received, bool created,
if (broadcast && GetGroup())
GetGroup()->BroadcastPacket(&data, true);
else
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
/*********************************************************/
@ -6520,7 +6520,7 @@ void Player::BindToInstance()
WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
data << uint32(0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
sInstanceSaveMgr->PlayerBindToInstance(this->GetGUID(), mapSave, true, this);
}
@ -6555,7 +6555,7 @@ void Player::SendRaidInfo()
}
}
data.put<uint32>(p_counter, counter);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
/*
@ -6582,7 +6582,7 @@ void Player::SendSavedInstances()
//Send opcode 811. true or false means, whether you have current raid/heroic instances
data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP);
data << uint32(hasBeenSaved);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
if (!hasBeenSaved)
return;
@ -6596,7 +6596,7 @@ void Player::SendSavedInstances()
{
data.Initialize(SMSG_UPDATE_LAST_INSTANCE);
data << uint32(itr->second.save->GetMapId());
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
}

View File

@ -1404,7 +1404,7 @@ void Player::UpdateHomebindTime(uint32 time)
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(0);
data << uint32(0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
// instance is valid, reset homebind timer
m_HomebindTimer = 0;
@ -1427,7 +1427,7 @@ void Player::UpdateHomebindTime(uint32 time)
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(m_HomebindTimer);
data << uint32(1);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
LOG_DEBUG(
"maps",
"PLAYER: Player '{}' ({}) will be teleported to homebind in 60 "
@ -1774,7 +1774,7 @@ void Player::UpdateTriggerVisibility()
WorldPacket packet;
udata.BuildPacket(packet);
GetSession()->SendPacket(&packet);
SendDirectMessage(&packet);
}
void Player::UpdateForQuestWorldObjects()
@ -1827,7 +1827,7 @@ void Player::UpdateForQuestWorldObjects()
WorldPacket packet;
udata.BuildPacket(packet);
GetSession()->SendPacket(&packet);
SendDirectMessage(&packet);
}
void Player::UpdateTitansGrip()

View File

@ -172,7 +172,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags)
}
data.put<uint32>(countPos, totalCount);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_CONTACT_LIST");
}
@ -288,7 +288,7 @@ void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, ObjectGui
if (broadcast)
BroadcastToFriendListers(player, &data);
else
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
@ -311,7 +311,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
if (pFriend && (!AccountMgr::IsPlayerAccount(pFriend->GetSession()->GetSecurity()) || ((pFriend->GetTeamId() == teamId || allowTwoSideWhoList) && security <= gmLevelInWhoList)) && player->IsVisibleGloballyFor(pFriend))
pFriend->GetSession()->SendPacket(packet);
pFriend->SendDirectMessage(packet);
}
}
}

View File

@ -13562,7 +13562,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry)
SendMessageToSet(&data, true);
data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
// mounts can also have accessories
GetVehicleKit()->InstallAllAccessories(false);
@ -13590,7 +13590,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry)
data << GetPackGUID();
data << player->GetSession()->GetOrderCounter(); // movement counter
data << player->GetCollisionHeight();
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
}
@ -13611,7 +13611,7 @@ void Unit::Dismount()
data << GetPackGUID();
data << player->GetSession()->GetOrderCounter(); // movement counter
data << player->GetCollisionHeight();
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
}
@ -16620,7 +16620,7 @@ void Unit::SendPetActionFeedback(uint8 msg) const
WorldPacket data(SMSG_PET_ACTION_FEEDBACK, 1);
data << uint8(msg);
owner->ToPlayer()->GetSession()->SendPacket(&data);
owner->ToPlayer()->SendDirectMessage(&data);
}
void Unit::SendPetActionSound(PetAction action) const
@ -16643,7 +16643,7 @@ void Unit::SendPetAIReaction(ObjectGuid guid) const
WorldPacket data(SMSG_AI_REACTION, 8 + 4);
data << guid;
data << uint32(AI_REACTION_HOSTILE);
owner->ToPlayer()->GetSession()->SendPacket(&data);
owner->ToPlayer()->SendDirectMessage(&data);
}
///----------End of Pet responses methods----------
@ -16749,7 +16749,7 @@ void Unit::SetStandState(uint8 state)
{
WorldPacket data(SMSG_STANDSTATE_UPDATE, 1);
data << (uint8)state;
ToPlayer()->GetSession()->SendPacket(&data);
ToPlayer()->SendDirectMessage(&data);
}
}
@ -19190,7 +19190,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
data << float(speedXY); // Horizontal speed
data << float(-speedZ); // Z Movement speed (vertical)
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
player->SetCanKnockback(true);
@ -19290,7 +19290,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward)
data << float(speedXY); // Horizontal speed
data << float(-speedZ); // Z Movement speed (vertical)
ToPlayer()->GetSession()->SendPacket(&data);
ToPlayer()->SendDirectMessage(&data);
}
}
@ -19448,7 +19448,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
bg->EventPlayerDroppedFlag(player);
WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
ASSERT(!m_vehicle);
@ -20408,7 +20408,7 @@ void Unit::SetCanFly(bool enable)
WorldPacket data(enable ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, GetPackGUID().size() + 4);
data << GetPackGUID();
data << counter;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
return;
}
@ -20444,7 +20444,7 @@ void Unit::SetFeatherFall(bool enable)
data << GetPackGUID();
data << counter;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
// start fall from current height
@ -20502,7 +20502,7 @@ void Unit::SetHover(bool enable)
data << GetPackGUID();
data << counter;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
return;
}
@ -20537,7 +20537,7 @@ void Unit::SetWaterWalking(bool enable)
WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4);
data << GetPackGUID();
data << counter;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
return;
}

View File

@ -83,7 +83,7 @@ void VisibleNotifier::SendToSelf()
WorldPacket packet;
i_data.BuildPacket(packet);
i_player.GetSession()->SendPacket(&packet);
i_player.SendDirectMessage(&packet);
for (std::vector<Unit*>::const_iterator it = i_visibleNow.begin(); it != i_visibleNow.end(); ++it)
i_player.GetInitialVisiblePackets(*it);

View File

@ -126,7 +126,7 @@ namespace Acore
if (!player->HaveAtClient(i_source))
return;
player->GetSession()->SendPacket(i_message);
player->SendDirectMessage(i_message);
}
};
@ -151,7 +151,7 @@ namespace Acore
if (player == i_source || !player->HaveAtClient(i_source) || player->IsFriendlyTo(i_source))
return;
player->GetSession()->SendPacket(i_message);
player->SendDirectMessage(i_message);
}
};

View File

@ -580,14 +580,14 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
if (method == GROUP_REMOVEMETHOD_KICK || method == GROUP_REMOVEMETHOD_KICK_LFG)
{
data.Initialize(SMSG_GROUP_UNINVITE, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
// Do we really need to send this opcode?
data.Initialize(SMSG_GROUP_LIST, 1 + 1 + 1 + 1 + 8 + 4 + 4 + 8);
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
data << m_guid << uint32(m_counter) << uint32(0) << uint64(0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
// Remove player from group in DB
@ -799,7 +799,7 @@ void Group::Disband(bool hideDestroy /* = false */)
if (!hideDestroy)
{
data.Initialize(SMSG_GROUP_DESTROYED, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
//we already removed player from group and in player->GetGroup() is his original group, send update
@ -812,7 +812,7 @@ void Group::Disband(bool hideDestroy /* = false */)
data.Initialize(SMSG_GROUP_LIST, 1 + 1 + 1 + 1 + 8 + 4 + 4 + 8);
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
data << m_guid << uint32(m_counter) << uint32(0) << uint64(0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
}
RollId.clear();
@ -870,7 +870,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r)
continue;
if (itr->second == NOT_EMITED_YET)
p->GetSession()->SendPacket(&data);
p->SendDirectMessage(&data);
}
}
@ -893,7 +893,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
voteMask &= ~ROLL_FLAG_TYPE_NEED;
data << uint8(voteMask); // roll type mask
p->GetSession()->SendPacket(&data);
p->SendDirectMessage(&data);
}
void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll, bool autoPass)
@ -916,7 +916,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rol
continue;
if (itr->second != NOT_VALID)
p->GetSession()->SendPacket(&data);
p->SendDirectMessage(&data);
}
}
@ -939,7 +939,7 @@ void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8
continue;
if (itr->second != NOT_VALID)
p->GetSession()->SendPacket(&data);
p->SendDirectMessage(&data);
}
}
@ -959,7 +959,7 @@ void Group::SendLootAllPassed(Roll const& roll)
continue;
if (itr->second != NOT_VALID)
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
}
@ -1353,7 +1353,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
for (Player* looter : looters)
{
looter->GetSession()->SendPacket(&data);
looter->SendDirectMessage(&data);
}
}
@ -1735,7 +1735,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
data << uint8(m_raidDifficulty >= RAID_DIFFICULTY_10MAN_HEROIC); // 3.3 Dynamic Raid Difficulty - 0 normal/1 heroic
}
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void Group::UpdatePlayerOutOfRange(Player* player)
@ -1750,7 +1750,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
{
Player* member = itr->GetSource();
if (member && (!member->IsInMap(player) || !member->IsWithinDist(player, member->GetSightRange(player), false)))
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
}
}
@ -1763,7 +1763,7 @@ void Group::BroadcastPacket(WorldPacket const* packet, bool ignorePlayersInBGRai
continue;
if (group == -1 || itr->getSubGroup() == group)
player->GetSession()->SendPacket(packet);
player->SendDirectMessage(packet);
}
}
@ -1774,7 +1774,7 @@ void Group::BroadcastReadyCheck(WorldPacket const* packet)
Player* player = itr->GetSource();
if (player)
if (IsLeader(player->GetGUID()) || IsAssistant(player->GetGUID()))
player->GetSession()->SendPacket(packet);
player->SendDirectMessage(packet);
}
}

View File

@ -2123,7 +2123,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
for (auto const& [guid, member] : m_members)
if (Player* player = member.FindPlayer())
if (_HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) && !player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()))
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
}
@ -2132,14 +2132,14 @@ void Guild::BroadcastPacketToRank(WorldPacket const* packet, uint8 rankId) const
for (auto const& [guid, member] : m_members)
if (member.IsRank(rankId))
if (Player* player = member.FindPlayer())
player->GetSession()->SendPacket(packet);
player->SendDirectMessage(packet);
}
void Guild::BroadcastPacket(WorldPacket const* packet) const
{
for (auto const& [guid, member] : m_members)
if (Player* player = member.FindPlayer())
player->GetSession()->SendPacket(packet);
player->SendDirectMessage(packet);
}
void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 maxLevel, uint32 minRank)

View File

@ -160,7 +160,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData)
WorldPacket data(SMSG_ARENA_TEAM_INVITE, (8 + 10));
data << GetPlayer()->GetName();
data << arenaTeam->GetName();
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
LOG_DEBUG("network", "WORLD: Sent SMSG_ARENA_TEAM_INVITE");
}

View File

@ -265,7 +265,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
{
WorldPacket data;
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err);
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
});
return;
@ -283,10 +283,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
// send status packet
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member->AddBattlegroundQueueId(bgQueueTypeId), STATUS_WAIT_QUEUE, avgWaitTime, 0, 0, TEAM_NEUTRAL);
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err);
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
sScriptMgr->OnPlayerJoinBG(member);
});
@ -879,7 +879,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
if (err <= 0)
{
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err);
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
continue;
}
@ -887,10 +887,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
// send status packet
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bgt, queueSlot, STATUS_WAIT_QUEUE, avgWaitTime, 0, arenatype, TEAM_NEUTRAL, isRated);
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err);
member->GetSession()->SendPacket(&data);
member->SendDirectMessage(&data);
LOG_DEBUG("bg.battleground", "Battleground: player joined queue for arena as group bg queue type {} bg type {}: {}, NAME {}", bgQueueTypeId, bgTypeId, member->GetGUID().ToString(), member->GetName());

View File

@ -803,7 +803,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData)
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_IGNORED, LANG_UNIVERSAL, _player, _player, GetPlayer()->GetName());
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void WorldSession::HandleChannelDeclineInvite(WorldPacket& recvPacket)

View File

@ -149,7 +149,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
data << uint32(0); // unk
data << uint8(0); // count
data << uint32(0); // unk
invitedPlayer->GetSession()->SendPacket(&data);
invitedPlayer->SendDirectMessage(&data);
}
return;
@ -209,7 +209,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
data << uint32(0); // unk
data << uint8(0); // count
data << uint32(0); // unk
invitedPlayer->GetSession()->SendPacket(&data);
invitedPlayer->SendDirectMessage(&data);
SendPartyResult(PARTY_OP_INVITE, membername, ERR_PARTY_RESULT_OK);
}
@ -292,7 +292,7 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket& /*recvData*/)
// report
WorldPacket data(SMSG_GROUP_DECLINE, GetPlayer()->GetName().length());
data << GetPlayer()->GetName();
leader->GetSession()->SendPacket(&data);
leader->SendDirectMessage(&data);
}
void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData)

View File

@ -206,7 +206,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1);
data << uint32(goldPerPlayer);
data << uint8(playersNear.size() > 1 ? 0 : 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..."
(*i)->GetSession()->SendPacket(&data);
(*i)->SendDirectMessage(&data);
}
}
else

View File

@ -494,7 +494,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
// update for owner if online
if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->ownerGuid))
owner->GetSession()->SendPacket(&data);
owner->SendDirectMessage(&data);
return;
}
@ -527,7 +527,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
// update for owner if online
if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->ownerGuid))
owner->GetSession()->SendPacket(&data);
owner->SendDirectMessage(&data);
}
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
@ -547,7 +547,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
{
WorldPacket data(MSG_PETITION_DECLINE, 8);
data << _player->GetGUID();
owner->GetSession()->SendPacket(&data);
owner->SendDirectMessage(&data);
}
}
@ -639,7 +639,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
data << uint32(0); // there 0 ...
}
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)

View File

@ -625,7 +625,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
WorldPacket data(MSG_QUEST_PUSH_RESULT, 8 + 4 + 1);
data << _player->GetGUID();
data << uint8(msg); // valid values: 0-8
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
_player->SetDivider();
}
}

View File

@ -60,7 +60,7 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData)
WorldPacket data2(SMSG_PROPOSE_LEVEL_GRANT, 8);
data2 << _player->GetPackGUID();
target->GetSession()->SendPacket(&data2);
target->SendDirectMessage(&data2);
}
void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData)

View File

@ -646,7 +646,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
WorldPacket data(SMSG_TRADE_STATUS, 12);
data << uint32(TRADE_STATUS_BEGIN_TRADE);
data << _player->GetGUID();
pOther->GetSession()->SendPacket(&data);
pOther->SendDirectMessage(&data);
}
void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket)

View File

@ -1691,7 +1691,7 @@ void Map::SendInitTransports(Player* player)
WorldPacket packet;
transData.BuildPacket(packet);
player->GetSession()->SendPacket(&packet);
player->SendDirectMessage(&packet);
}
void Map::SendRemoveTransports(Player* player)
@ -1710,7 +1710,7 @@ void Map::SendRemoveTransports(Player* player)
WorldPacket packet;
transData.BuildPacket(packet);
player->GetSession()->SendPacket(&packet);
player->SendDirectMessage(&packet);
}
void Map::SendObjectUpdates()
@ -1730,7 +1730,7 @@ void Map::SendObjectUpdates()
for (UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
{
iter->second.BuildPacket(packet);
iter->first->GetSession()->SendPacket(&packet);
iter->first->SendDirectMessage(&packet);
packet.clear(); // clean the string
}
}
@ -1850,7 +1850,7 @@ uint32 Map::GetPlayersCountExceptGMs() const
void Map::SendToPlayers(WorldPacket const* data) const
{
for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
itr->GetSource()->GetSession()->SendPacket(data);
itr->GetSource()->SendDirectMessage(data);
}
template bool Map::AddToMap(Corpse*, bool);
@ -2055,7 +2055,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
data << uint32(60000);
data << uint32(instance_data ? instance_data->GetCompletedEncounterMask() : 0);
data << uint8(0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->SetPendingBind(mapSave->GetInstanceId(), 60000);
}
}
@ -2227,7 +2227,7 @@ void InstanceMap::PermBindAllPlayers()
{
WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
data << uint32(0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
sInstanceSaveMgr->PlayerBindToInstance(player->GetGUID(), save, true, player);
}

View File

@ -205,7 +205,7 @@ Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool log
if (!corpseMap)
{
WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE, 0);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
LOG_DEBUG("maps", "MAP: Player '{}' does not have a corpse in instance '{}' and cannot enter.", player->GetName(), mapName);
return Map::CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE;
}

View File

@ -635,7 +635,7 @@ void OutdoorPvP::BroadcastPacket(WorldPacket& data) const
for (auto const& playerSet : _players)
for (auto itr : playerSet)
if (Player* const player = ObjectAccessor::FindPlayer(itr))
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void OutdoorPvP::RegisterZone(uint32 zoneId)

View File

@ -6177,7 +6177,7 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode,
if (apply)
{
data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
target->ToPlayer()->GetSession()->SendPacket(&data);
target->ToPlayer()->SendDirectMessage(&data);
}
}

View File

@ -4612,7 +4612,7 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas
WorldPacket data(SMSG_CAST_FAILED, 1 + 4 + 1);
WriteCastResultInfo(data, caster, spellInfo, castCount, result, customError);
caster->GetSession()->SendPacket(&data);
caster->SendDirectMessage(&data);
}
void Spell::SendCastResult(SpellCastResult result)
@ -4649,7 +4649,7 @@ void Spell::SendPetCastResult(SpellCastResult result)
WorldPacket data(SMSG_PET_CAST_FAILED, 1 + 4 + 1);
WriteCastResultInfo(data, player, m_spellInfo, m_cast_count, result, m_customError);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void Spell::SendSpellStart()
@ -5184,7 +5184,7 @@ void Spell::SendResurrectRequest(Player* target)
// override delay sent with SMSG_CORPSE_RECLAIM_DELAY, set instant resurrection for spells with this attribute
if (m_spellInfo->HasAttribute(SPELL_ATTR3_NO_RES_TIMER))
data << uint32(0);
target->GetSession()->SendPacket(&data);
target->SendDirectMessage(&data);
}
void Spell::TakeCastItem()

View File

@ -4162,8 +4162,8 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
WorldPacket data(SMSG_DUEL_REQUESTED, 8 + 8);
data << pGameObj->GetGUID();
data << caster->GetGUID();
caster->GetSession()->SendPacket(&data);
target->GetSession()->SendPacket(&data);
caster->SendDirectMessage(&data);
target->SendDirectMessage(&data);
// create duel-info
bool isMounted = (GetSpellInfo()->Id == 62875);
@ -4245,7 +4245,7 @@ void Spell::EffectSummonPlayer(SpellEffIndex /*effIndex*/)
data << m_caster->GetGUID(); // summoner guid
data << uint32(m_caster->GetZoneId()); // summoner zone
data << uint32(MAX_PLAYER_SUMMON_DELAY * IN_MILLISECONDS); // auto decline after msecs
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void Spell::EffectActivateObject(SpellEffIndex effIndex)
@ -6345,5 +6345,5 @@ void Spell::EffectSummonRaFFriend(SpellEffIndex /*effIndex*/)
data << m_caster->GetGUID();
data << uint32(m_caster->GetZoneId());
data << uint32(MAX_PLAYER_SUMMON_DELAY * IN_MILLISECONDS); // auto decline after msecs
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}

View File

@ -309,7 +309,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
if (!target || !target->IsPlayer())
return;
target->ToPlayer()->GetSession()->SendPacket(data);
target->ToPlayer()->SendDirectMessage(data);
return;
}
break;
@ -326,7 +326,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
Map::PlayerList const& players = source->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (itr->GetSource()->GetAreaId() == areaId && (teamId == TEAM_NEUTRAL || itr->GetSource()->GetTeamId() == teamId) && (!gmOnly || itr->GetSource()->IsGameMaster()))
itr->GetSource()->GetSession()->SendPacket(data);
itr->GetSource()->SendDirectMessage(data);
return;
}
case TEXT_RANGE_ZONE:
@ -335,7 +335,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
Map::PlayerList const& players = source->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (itr->GetSource()->GetZoneId() == zoneId && (teamId == TEAM_NEUTRAL || itr->GetSource()->GetTeamId() == teamId) && (!gmOnly || itr->GetSource()->IsGameMaster()))
itr->GetSource()->GetSession()->SendPacket(data);
itr->GetSource()->SendDirectMessage(data);
return;
}
case TEXT_RANGE_MAP:
@ -343,7 +343,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
Map::PlayerList const& players = source->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if ((teamId == TEAM_NEUTRAL || itr->GetSource()->GetTeamId() == teamId) && (!gmOnly || itr->GetSource()->IsGameMaster()))
itr->GetSource()->GetSession()->SendPacket(data);
itr->GetSource()->SendDirectMessage(data);
return;
}
case TEXT_RANGE_WORLD:
@ -352,7 +352,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
if (Player* player = itr->second->GetPlayer())
if ((teamId == TEAM_NEUTRAL || player->GetTeamId() == teamId) && (!gmOnly || player->IsGameMaster()))
player->GetSession()->SendPacket(data);
player->SendDirectMessage(data);
return;
}
case TEXT_RANGE_NORMAL:

View File

@ -433,7 +433,7 @@ public:
}
data.hexlike();
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
return true;
}

View File

@ -487,7 +487,7 @@ public:
uint32 queueSlot = 0;
WorldPacket data;
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType(), teamId);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
// Remove from LFG queues
sLFGMgr->LeaveAllLfgQueues(player->GetGUID(), false);

View File

@ -328,7 +328,7 @@ public:
data << uint8(op);
data << uint16(val);
data << uint16(mark ? *mark : 65535);
target->GetSession()->SendPacket(&data);
target->SendDirectMessage(&data);
return true;
}

View File

@ -146,7 +146,7 @@ public:
{
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
submitter->GetSession()->SendPacket(&data);
submitter->SendDirectMessage(&data);
ChatHandler(submitter->GetSession()).SendSysMessage(LANG_TICKET_CLOSED);
}
return true;
@ -259,7 +259,7 @@ public:
// Force abandon ticket
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
return true;

View File

@ -382,7 +382,7 @@ class spell_madrigosa_activate_barrier : public SpellScript
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, player);
data.BuildPacket(pkt);
player->GetSession()->SendPacket(&pkt);
player->SendDirectMessage(&pkt);
});
}
}
@ -409,7 +409,7 @@ class spell_madrigosa_deactivate_barrier : public SpellScript
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, player);
data.BuildPacket(pkt);
player->GetSession()->SendPacket(&pkt);
player->SendDirectMessage(&pkt);
});
}
}

View File

@ -199,7 +199,7 @@ public:
WorldPacket data(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, 4);
data << uint32(ENCOUNTER_FRAME_REFRESH_FRAMES);
_owner->GetSession()->SendPacket(&data);
_owner->SendDirectMessage(&data);
return true;
}

View File

@ -196,7 +196,7 @@ public:
data << uint32(VEHICLE_SPELL_RIDE_HARDCODED);
data << uint8(SPELL_FAILED_CUSTOM_ERROR);
data << uint32(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
clicker->ToPlayer()->GetSession()->SendPacket(&data);
clicker->ToPlayer()->SendDirectMessage(&data);
return false;
}
};

View File

@ -2272,7 +2272,7 @@ class spell_igb_overheat_aura : public AuraScript
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, GetUnitOwner()->GetPackGUID().size() + 1);
data << GetUnitOwner()->GetPackGUID();
data << uint8(value);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
}
}

View File

@ -375,7 +375,7 @@ void SendPacketToPlayers(WorldPacket const* data, Unit* source)
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->GetAreaId() == AREA_THE_FROZEN_THRONE)
player->GetSession()->SendPacket(data);
player->SendDirectMessage(data);
}
struct ShadowTrapLKTargetSelector

View File

@ -184,7 +184,7 @@ public:
data << spellId;
data << uint8(SPELL_FAILED_CUSTOM_ERROR);
data << uint32(SPELL_CUSTOM_ERROR_CANT_BUILD_MORE_VEHICLES);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
return true;
}

View File

@ -567,9 +567,9 @@ struct npc_pet_gen_imp_in_a_bottle : public NullCreatureAI
for (GroupReference* itr = player->GetGroup()->GetFirstMember(); itr != nullptr && limit < 4; itr = itr->next(), ++limit)
if (Player* groupPlayer = itr->GetSource())
if (groupPlayer != player)
groupPlayer->GetSession()->SendPacket(&_data);
groupPlayer->SendDirectMessage(&_data);
player->GetSession()->SendPacket(&_data);
player->SendDirectMessage(&_data);
}
}
}

View File

@ -1970,7 +1970,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScript
{
WorldPacket data;
player->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_INCLUDE_GCD, 7744, GetSpellInfo()->CategoryRecoveryTime); // Will of the forsaken
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
else
{
@ -1983,11 +1983,11 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScript
data << uint16(GetSpellInfo()->GetCategory()); // spell category
data << uint32(0);
data << uint32(GetSpellInfo()->CategoryRecoveryTime);
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
WorldPacket data2;
player->BuildCooldownPacket(data2, SPELL_COOLDOWN_FLAG_INCLUDE_GCD, SPELL_PVP_TRINKET, GetSpellInfo()->CategoryRecoveryTime); // PvP Trinket spell
player->GetSession()->SendPacket(&data2);
player->SendDirectMessage(&data2);
}
}
}
@ -2650,7 +2650,7 @@ class spell_gen_spirit_healer_res : public SpellScript
{
WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
data << target->GetGUID();
originalCaster->GetSession()->SendPacket(&data);
originalCaster->SendDirectMessage(&data);
}
}