Merge remote-tracking branch 'upstream/master' into update/core_4_11_2025

# Conflicts:
#	src/server/game/Guilds/Guild.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
This commit is contained in:
bash
2025-11-04 20:07:10 +01:00
168 changed files with 2111 additions and 1581 deletions
+1 -1
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);
}
}
+1 -1
View File
@@ -182,7 +182,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
if (me->IsMoveInLineOfSightDisabled())
if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET || // nothing more to do, return
!who->IsInCombat() || // if not in combat, nothing more to do
!me->IsWithinDist(who, ATTACK_DISTANCE, true, false)) // if in combat and in dist - neutral to all can actually assist other creatures
!me->IsWithinDist(who, ATTACK_DISTANCE, true, false, false)) // if in combat and in dist - neutral to all can actually assist other creatures
return;
if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who))
@@ -566,7 +566,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
std::vector<Player*> tList;
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
{
if (!me->IsWithinDistInMap(itr->GetSource(), maxdist, true, false) || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
if (!me->IsWithinDistInMap(itr->GetSource(), maxdist, true, false, false) || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
continue;
if (excludeAura && itr->GetSource()->HasAura(excludeAura))
continue;
@@ -218,10 +218,10 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
{
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
if (Player* member = groupRef->GetSource())
if (me->IsWithinDistInMap(member, GetMaxPlayerDistance(), true, false))
if (me->IsWithinDistInMap(member, GetMaxPlayerDistance(), true, false, false))
return true;
}
else if (me->IsWithinDistInMap(player, GetMaxPlayerDistance(), true, false))
else if (me->IsWithinDistInMap(player, GetMaxPlayerDistance(), true, false, false))
return true;
}
@@ -202,7 +202,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
{
Player* member = groupRef->GetSource();
if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE, true, false))
if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE, true, false, false))
{
bIsMaxRangeExceeded = false;
break;
@@ -211,7 +211,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
}
else
{
if (me->IsWithinDistInMap(player, MAX_PLAYER_DISTANCE, true, false))
if (me->IsWithinDistInMap(player, MAX_PLAYER_DISTANCE, true, false, false))
bIsMaxRangeExceeded = false;
}
}
@@ -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);
}
/**
@@ -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<>
@@ -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;
}
@@ -203,6 +203,6 @@ void AutobroadcastMgr::SendNotificationAnnouncement(uint8 textId)
data << localizedMessage;
// Send packet to the player
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
});
}
+4 -4
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);
}
// ----------------------
+2 -2
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)
+10 -10
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
@@ -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)
@@ -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);
}
}
@@ -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);
}
}
+4 -4
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
+1 -1
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;
+3 -3
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
}
@@ -771,7 +771,7 @@ void Creature::Update(uint32 diff)
}
Unit* owner = GetCharmerOrOwner();
if (IsCharmed() && !IsWithinDistInMap(owner, GetMap()->GetVisibilityRange(), true, false))
if (IsCharmed() && !IsWithinDistInMap(owner, GetMap()->GetVisibilityRange(), true, false, false))
{
RemoveCharmAuras();
}
@@ -1945,7 +1945,7 @@ bool Creature::CanStartAttack(Unit const* who) const
if (!_IsTargetAcceptable(who))
return false;
if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false)) // pussywizard: +m_combatDistance for turrets and similar
if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false, false)) // pussywizard: +m_combatDistance for turrets and similar
return false;
if (!CanCreatureAttack(who))
@@ -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();
@@ -414,7 +414,7 @@ private:
void UpdatePackedRotation();
//! Object distance/size - overridden from Object::_IsWithinDist. Needs to take in account proper GO size.
bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/, bool /*useBoundingRadius = true*/) const override
bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/, bool /*incOwnRadius = true*/, bool /*incTargetRadius = true*/) const override
{
//! Following check does check 3d distance
dist2compare += obj->GetObjectSize();
+2 -2
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, bool temp)
+15 -11
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
@@ -1232,10 +1232,14 @@ float WorldObject::GetDistanceZ(WorldObject const* obj) const
return (dist > 0 ? dist : 0);
}
bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool useBoundingRadius) const
bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool incOwnRadius, bool incTargetRadius) const
{
float sizefactor = useBoundingRadius ? GetObjectSize() + obj->GetObjectSize() : 0.0f;
float maxdist = dist2compare + sizefactor;
float maxdist = dist2compare;
if (incOwnRadius)
maxdist += GetObjectSize();
if (incTargetRadius)
maxdist += obj->GetObjectSize();
if (m_transport && obj->GetTransport() && obj->GetTransport()->GetGUID() == m_transport->GetGUID())
{
@@ -1342,14 +1346,14 @@ bool WorldObject::IsWithinDist2d(const Position* pos, float dist) const
}
// use only if you will sure about placing both object at same map
bool WorldObject::IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool useBoundingRadius) const
bool WorldObject::IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool incOwnRadius, bool incTargetRadius) const
{
return obj && _IsWithinDist(obj, dist2compare, is3D, useBoundingRadius);
return obj && _IsWithinDist(obj, dist2compare, is3D, incOwnRadius, incTargetRadius);
}
bool WorldObject::IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D, bool useBoundingRadius) const
bool WorldObject::IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D, bool incOwnRadius, bool incTargetRadius) const
{
return obj && IsInMap(obj) && InSamePhase(obj) && _IsWithinDist(obj, dist2compare, is3D, useBoundingRadius);
return obj && IsInMap(obj) && InSamePhase(obj) && _IsWithinDist(obj, dist2compare, is3D, incOwnRadius, incTargetRadius);
}
bool WorldObject::IsWithinLOS(float ox, float oy, float oz, VMAP::ModelIgnoreFlags ignoreFlags, LineOfSightChecks checks) const
@@ -2065,7 +2069,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
}
+3 -3
View File
@@ -541,8 +541,8 @@ public:
[[nodiscard]] bool IsWithinDist2d(float x, float y, float dist) const;
bool IsWithinDist2d(const Position* pos, float dist) const;
// use only if you will sure about placing both object at same map
bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true, bool useBoundingRadius = true) const;
bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true, bool useBoundingRadius = true) const;
bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true, bool incOwnRadius = true, bool incTargetRadius = true) const;
bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true, bool incOwnRadius = true, bool incTargetRadius = true) const;
[[nodiscard]] bool IsWithinLOS(float x, float y, float z, VMAP::ModelIgnoreFlags ignoreFlags = VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks = LINEOFSIGHT_ALL_CHECKS) const;
[[nodiscard]] bool IsWithinLOSInMap(WorldObject const* obj, VMAP::ModelIgnoreFlags ignoreFlags = VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks = LINEOFSIGHT_ALL_CHECKS, Optional<float> collisionHeight = { }, Optional<float> combatReach = { }) const;
[[nodiscard]] Position GetHitSpherePointFor(Position const& dest, Optional<float> collisionHeight = { }, Optional<float> combatReach = { }) const;
@@ -770,7 +770,7 @@ private:
uint16 m_notifyflags;
uint16 m_executed_notifies;
virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool useBoundingRadius = true) const;
virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D, bool incOwnRadius = true, bool incTargetRadius = true) const;
bool CanNeverSee(WorldObject const* obj) const;
virtual bool CanAlwaysSee(WorldObject const* /*obj*/) const { return false; }
+1 -1
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);
}
}
}
+76 -73
View File
@@ -78,6 +78,7 @@
#include "TicketMgr.h"
#include "Tokenize.h"
#include "Transport.h"
#include "Unit.h"
#include "UpdateData.h"
#include "Util.h"
#include "Vehicle.h"
@@ -418,7 +419,7 @@ Player::Player(WorldSession* session): Unit(), m_mover(this)
sScriptMgr->OnConstructPlayer(this);
m_expectingChangeTransport = false;
_expectingChangeTransport = false;
}
Player::~Player()
@@ -1342,7 +1343,7 @@ void Player::SendTeleportAckPacket()
data << GetPackGUID();
data << GetSession()->GetOrderCounter(); // movement counter
BuildMovementPacket(&data);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
GetSession()->IncrementOrderCounter();
}
@@ -1549,6 +1550,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
//remove auras before removing from map...
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING);
SetMapChangeOrderCounter();
if (!GetSession()->PlayerLogout())
{
// send transfer packets
@@ -1557,7 +1560,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
@@ -1579,7 +1582,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();
}
@@ -2361,7 +2364,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)
@@ -2838,7 +2841,7 @@ void Player::SendInitialSpells()
data << uint32(itr->second.category ? cooldown : 0); // category cooldown
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::RemoveMail(uint32 id)
@@ -2867,7 +2870,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()
@@ -2875,7 +2878,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)
@@ -3033,13 +3036,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);
}
}
@@ -3071,7 +3074,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 +4429,7 @@ void Player::SetMovement(PlayerMovementType pType)
}
data << guid;
data << GetSession()->GetOrderCounter(); // movement counter
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
GetSession()->IncrementOrderCounter();
}
@@ -4438,7 +4441,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 +4496,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 +4983,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()))
@@ -5599,7 +5602,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);
}
@@ -6226,7 +6229,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);
@@ -6419,7 +6422,7 @@ void Player::CheckDuelDistance(time_t currTime)
duel->OutOfBoundsTime = currTime + 10;
WorldPacket data(SMSG_DUEL_OUTOFBOUNDS, 0);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
else
@@ -6429,7 +6432,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);
@@ -6604,13 +6607,13 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
LOG_DEBUG("entities.player", "applying mods for item {} ", item->GetGUID().ToString());
uint8 attacktype = Player::GetAttackBySlot(slot);
WeaponAttackType attacktype = Player::GetAttackBySlot(slot);
if (item->HasSocket()) //only (un)equipping of items with sockets can influence metagems, so no need to waste time with normal items
CorrectMetaGemEnchants(slot, apply);
if (attacktype < MAX_ATTACK)
_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), apply);
_ApplyWeaponDependentAuraMods(item, attacktype, apply);
_ApplyItemBonuses(proto, slot, apply);
@@ -6897,7 +6900,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
if (proto->ArcaneRes)
HandleStatModifier(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(proto->ArcaneRes), apply);
uint8 attType = Player::GetAttackBySlot(slot);
WeaponAttackType attType = Player::GetAttackBySlot(slot);
if (attType != MAX_ATTACK)
{
_ApplyWeaponDamage(slot, proto, ssv, apply);
@@ -6944,7 +6947,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
ssv = ScalingStatValue ? sScalingStatValuesStore.LookupEntry(ssd_level) : nullptr;
}
uint8 attType = Player::GetAttackBySlot(slot);
WeaponAttackType attType = Player::GetAttackBySlot(slot);
if (!IsInFeralForm() && apply && !CanUseAttackType(attType))
{
return;
@@ -6975,12 +6978,12 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
if (minDamage > 0.f)
{
SetBaseWeaponDamage(WeaponAttackType(attType), MINDAMAGE, minDamage, i);
SetBaseWeaponDamage(attType, MINDAMAGE, minDamage, i);
}
if (maxDamage > 0.f)
{
SetBaseWeaponDamage(WeaponAttackType(attType), MAXDAMAGE, maxDamage, i);
SetBaseWeaponDamage(attType, MAXDAMAGE, maxDamage, i);
}
}
}
@@ -6989,8 +6992,8 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
{
for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
{
SetBaseWeaponDamage(WeaponAttackType(attType), MINDAMAGE, 0.f, i);
SetBaseWeaponDamage(WeaponAttackType(attType), MAXDAMAGE, 0.f, i);
SetBaseWeaponDamage(attType, MINDAMAGE, 0.f, i);
SetBaseWeaponDamage(attType, MAXDAMAGE, 0.f, i);
}
if (attType == BASE_ATTACK)
@@ -7014,8 +7017,8 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
if (IsInFeralForm())
return;
if (CanModifyStats() && (GetWeaponDamageRange(WeaponAttackType(attType), MAXDAMAGE) || proto->Delay))
UpdateDamagePhysical(WeaponAttackType(attType));
if (CanModifyStats() && (GetWeaponDamageRange(attType, MAXDAMAGE) || proto->Delay))
UpdateDamagePhysical(attType);
}
void Player::CastAllObtainSpells()
@@ -7608,9 +7611,9 @@ void Player::_RemoveAllItemMods()
if (!proto)
continue;
uint32 attacktype = Player::GetAttackBySlot(i);
WeaponAttackType attacktype = Player::GetAttackBySlot(i);
if (attacktype < MAX_ATTACK)
_ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), false);
_ApplyWeaponDependentAuraMods(m_items[i], attacktype, false);
_ApplyItemBonuses(proto, i, false);
@@ -7637,9 +7640,9 @@ void Player::_ApplyAllItemMods()
if (!proto)
continue;
uint32 attacktype = Player::GetAttackBySlot(i);
WeaponAttackType attacktype = Player::GetAttackBySlot(i);
if (attacktype < MAX_ATTACK)
_ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), true);
_ApplyWeaponDependentAuraMods(m_items[i], attacktype, true);
_ApplyItemBonuses(proto, i, true);
@@ -7792,7 +7795,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
@@ -8239,14 +8242,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
@@ -8951,7 +8954,7 @@ void Player::SetBindPoint(ObjectGuid guid)
{
WorldPacket data(SMSG_BINDER_CONFIRM, 8);
data << guid;
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SendTalentWipeConfirm(ObjectGuid guid)
@@ -8960,7 +8963,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()
@@ -9223,7 +9226,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);
@@ -9510,14 +9513,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())
{
@@ -9626,7 +9629,7 @@ void Player::PetSpellInitialize()
data << uint32(category ? cooldown : 0); // category cooldown
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::PossessSpellInitialize()
@@ -9654,7 +9657,7 @@ void Player::PossessSpellInitialize()
data << uint8(0); // spells count
data << uint8(0); // cooldowns count
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::VehicleSpellInitialize()
@@ -9729,7 +9732,7 @@ void Player::VehicleSpellInitialize()
data << uint32(category ? cooldown : 0); // category cooldown
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::CharmSpellInitialize()
@@ -9783,14 +9786,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)
@@ -10140,7 +10143,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)
@@ -10592,7 +10595,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
if (!cooldowns.empty())
{
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, cooldowns);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
@@ -10712,7 +10715,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)
@@ -11129,7 +11132,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*/)
@@ -11605,7 +11608,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
@@ -11618,13 +11621,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();
@@ -11636,7 +11639,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
@@ -11788,7 +11791,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)
@@ -11823,7 +11826,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)
@@ -11870,7 +11873,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
WorldPacket data(SMSG_ITEM_COOLDOWN, 12);
data << pItem->GetGUID();
data << uint32(spellData.SpellId);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
@@ -12142,7 +12145,7 @@ void Player::GetAurasForTarget(Unit* target, bool force /*= false*/)
auraApp->BuildUpdatePacket(data, false);
}
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::SetDailyQuestStatus(uint32 quest_id)
@@ -12912,7 +12915,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)
@@ -13033,7 +13036,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)
@@ -13260,7 +13263,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
SetSeer(this);
//WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
//GetSession()->SendPacket(&data);
//SendDirectMessage(&data);
}
}
@@ -13416,7 +13419,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);
}
@@ -13476,7 +13479,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)
@@ -13488,14 +13491,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] =
@@ -14553,7 +14556,7 @@ void Player::SendTalentsInfoData(bool pet)
BuildPetTalentsInfoData(&data);
else
BuildPlayerTalentsInfoData(&data);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
void Player::BuildEnchantmentsInfoData(WorldPacket* data)
@@ -14626,7 +14629,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)
@@ -14664,7 +14667,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;
@@ -15475,7 +15478,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)
@@ -15679,7 +15682,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)
@@ -15727,7 +15730,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;
}
@@ -15768,7 +15771,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;
}
@@ -15783,7 +15786,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
+12 -4
View File
@@ -1247,7 +1247,7 @@ public:
bool HasWeapon(WeaponAttackType type) const override { return GetWeaponForAttack(type, false); }
bool HasWeaponForAttack(WeaponAttackType type) const override { return (Unit::HasWeaponForAttack(type) && GetWeaponForAttack(type, true)); }
[[nodiscard]] Item* GetShield(bool useable = false) const;
static uint8 GetAttackBySlot(uint8 slot); // MAX_ATTACK if not weapon slot
static WeaponAttackType GetAttackBySlot(uint8 slot); // MAX_ATTACK if not weapon slot
std::vector<Item*>& GetItemUpdateQueue() { return m_itemUpdateQueue; }
static bool IsInventoryPos(uint16 pos) { return IsInventoryPos(pos >> 8, pos & 255); }
static bool IsInventoryPos(uint8 bag, uint8 slot);
@@ -2627,8 +2627,14 @@ public:
std::string GetDebugInfo() const override;
bool IsExpectingChangeTransport() const { return m_expectingChangeTransport; }
void SetExpectingChangeTransport(bool state) { m_expectingChangeTransport = state; }
bool IsExpectingChangeTransport() const { return _expectingChangeTransport; }
void SetExpectingChangeTransport(bool state) { _expectingChangeTransport = state; }
uint32 GetPendingFlightChange() const { return _pendingFlightChangeCounter; }
void SetPendingFlightChange(uint32 counter) { _pendingFlightChangeCounter = counter; }
void SetMapChangeOrderCounter() { _mapChangeOrderCounter = GetSession()->GetOrderCounter(); }
uint32 GetMapChangeOrderCounter() { return _mapChangeOrderCounter; }
/*********************************************************/
/*** SPELL QUEUE SYSTEM ***/
@@ -3011,7 +3017,9 @@ private:
Seconds m_creationTime;
bool m_expectingChangeTransport;
bool _expectingChangeTransport;
uint32 _pendingFlightChangeCounter;
uint32 _mapChangeOrderCounter;
};
void AddItemsSetItem(Player* player, Item* item);
+11 -11
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);
}
/*********************************************************/
+11 -11
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)
@@ -51,6 +51,7 @@
#include "QuestDef.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "ScriptObjectFwd.h"
#include "SocialMgr.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
@@ -539,7 +540,7 @@ Item* Player::GetShield(bool useable) const
return item;
}
uint8 Player::GetAttackBySlot(uint8 slot)
WeaponAttackType Player::GetAttackBySlot(uint8 slot)
{
switch (slot)
{
@@ -2782,7 +2783,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);
}
}
}
@@ -4076,7 +4077,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)
@@ -4088,7 +4089,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)
@@ -4100,7 +4101,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*/)
@@ -4795,7 +4796,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);
}
/*********************************************************/
@@ -6545,7 +6546,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);
}
@@ -6580,7 +6581,7 @@ void Player::SendRaidInfo()
}
}
data.put<uint32>(p_counter, counter);
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
/*
@@ -6607,7 +6608,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;
@@ -6621,7 +6622,7 @@ void Player::SendSavedInstances()
{
data.Initialize(SMSG_UPDATE_LAST_INSTANCE);
data << uint32(itr->second.save->GetMapId());
GetSession()->SendPacket(&data);
SendDirectMessage(&data);
}
}
}
@@ -1402,7 +1402,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;
@@ -1425,7 +1425,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 "
@@ -1772,7 +1772,7 @@ void Player::UpdateTriggerVisibility()
WorldPacket packet;
udata.BuildPacket(packet);
GetSession()->SendPacket(&packet);
SendDirectMessage(&packet);
}
void Player::UpdateForQuestWorldObjects()
@@ -1825,7 +1825,7 @@ void Player::UpdateForQuestWorldObjects()
WorldPacket packet;
udata.BuildPacket(packet);
GetSession()->SendPacket(&packet);
SendDirectMessage(&packet);
}
void Player::UpdateTitansGrip()
@@ -1969,10 +1969,7 @@ void Player::UpdateCharmedAI()
Unit* target = GetVictim();
if (target)
{
SetInFront(target);
SendMovementFlagUpdate(true);
}
if (HasUnitState(UNIT_STATE_CASTING))
return;
@@ -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);
}
}
}
+27 -15
View File
@@ -8179,7 +8179,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (triggeredByAura->GetBase() && castItem->GetGUID() != triggeredByAura->GetBase()->GetCastItemGUID())
return false;
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
WeaponAttackType attType = player->GetAttackBySlot(castItem->GetSlot());
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
|| (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
|| (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
@@ -8370,7 +8370,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!IsPlayer() || !victim || !victim->IsAlive() || !castItem || !castItem->IsEquipped())
return false;
WeaponAttackType attType = WeaponAttackType(Player::GetAttackBySlot(castItem->GetSlot()));
WeaponAttackType attType = Player::GetAttackBySlot(castItem->GetSlot());
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
|| (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
|| (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
@@ -10969,7 +10969,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
charm->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
}
else
{
charm->m_ControlledByPlayer = false;
if (!HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
charm->RemoveUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
}
// PvP, FFAPvP
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
@@ -13568,7 +13572,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);
@@ -13596,7 +13600,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();
}
@@ -13617,7 +13621,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();
}
@@ -16626,7 +16630,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
@@ -16649,7 +16653,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----------
@@ -16715,6 +16719,13 @@ void Unit::StopMovingOnCurrentPos()
void Unit::SendMovementFlagUpdate(bool self /* = false */)
{
if (IsRooted())
{
// each case where this occurs has to be examined and reported and dealt with.
LOG_ERROR("Unit", "Attempted sending heartbeat with root flag for guid {}", GetGUID().ToString());
return;
}
WorldPacket data;
BuildHeartBeatMsg(&data);
SendMessageToSet(&data, self);
@@ -16755,7 +16766,7 @@ void Unit::SetStandState(uint8 state)
{
WorldPacket data(SMSG_STANDSTATE_UPDATE, 1);
data << (uint8)state;
ToPlayer()->GetSession()->SendPacket(&data);
ToPlayer()->SendDirectMessage(&data);
}
}
@@ -19210,7 +19221,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);
@@ -19310,7 +19321,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);
}
}
@@ -19468,7 +19479,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);
@@ -20423,11 +20434,12 @@ void Unit::SetCanFly(bool enable)
if (Player const* player = GetClientControlling())
{
uint32 const counter = player->GetSession()->GetOrderCounter();
const_cast<Player*>(player)->SetPendingFlightChange(counter);
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;
}
@@ -20463,7 +20475,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
@@ -20521,7 +20533,7 @@ void Unit::SetHover(bool enable)
data << GetPackGUID();
data << counter;
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
player->GetSession()->IncrementOrderCounter();
return;
}
@@ -20556,7 +20568,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;
}
+1 -1
View File
@@ -967,7 +967,7 @@ public:
inline bool HasMainhandWeaponForAttack() const { return HasWeaponForAttack(BASE_ATTACK); }
inline bool HasOffhandWeaponForAttack() const { return HasWeaponForAttack(OFF_ATTACK); }
inline bool HasRangedWeaponForAttack() const { return HasWeaponForAttack(RANGED_ATTACK); }
[[nodiscard]] bool CanUseAttackType(uint8 attacktype) const
[[nodiscard]] bool CanUseAttackType(WeaponAttackType attacktype) const
{
switch (attacktype)
{
@@ -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);
@@ -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);
}
};
@@ -1092,10 +1092,9 @@ namespace Acore
{
return false;
}
}
if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->IsDynamicObject() ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range,true,false))
if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->IsDynamicObject() ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range,true,false, true))
return true;
@@ -1192,7 +1191,7 @@ namespace Acore
}
bool operator()(Unit* u)
{
if (!me->IsWithinDistInMap(u, m_range, true, false))
if (!me->IsWithinDistInMap(u, m_range, true, false, false))
return false;
if (!me->IsValidAttackTarget(u))
@@ -1218,7 +1217,7 @@ namespace Acore
explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist) : me(creature), m_range(dist) {}
bool operator()(Unit* u)
{
if (!me->IsWithinDistInMap(u, m_range, true, false))
if (!me->IsWithinDistInMap(u, m_range, true, false, false))
return false;
if (!me->CanStartAttack(u))
+14 -14
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);
}
}
+5 -5
View File
@@ -2152,7 +2152,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);
}
}
@@ -2161,14 +2161,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)
@@ -2206,14 +2206,14 @@ void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 max
// Members handling
bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
{
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
Player* leader = nullptr;
if (this->GetLeaderGUID())
{
leader = ObjectAccessor::FindConnectedPlayer(this->GetLeaderGUID());
}
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
// Player cannot be in guild
if (player)
{
@@ -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");
}
@@ -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());
+1 -1
View File
@@ -812,7 +812,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)
+3 -3
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)
+1 -1
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
+7
View File
@@ -1519,12 +1519,19 @@ void WorldSession::HandleMoveFlagChangeOpcode(WorldPacket& recv_data)
mover->m_movementInfo.flags = movementInfo.GetMovementFlags();
// old map - async processing, ignore
if (counter <= _player->GetMapChangeOrderCounter())
return;
if (!ProcessMovementInfo(movementInfo, mover, plrMover, recv_data))
{
recv_data.rfinish(); // prevent warnings spam
return;
}
if (_player->GetPendingFlightChange() == counter && opcode == CMSG_MOVE_SET_CAN_FLY_ACK)
_player->SetPendingFlightChange(false);
Opcodes response;
switch (recv_data.GetOpcode())
@@ -105,6 +105,13 @@ void WorldSession::HandleMoveWorldportAck()
GetPlayer()->UpdatePositionData();
GetPlayer()->SendInitialPacketsBeforeAddToMap();
if (GetPlayer()->GetPendingFlightChange() <= GetPlayer()->GetMapChangeOrderCounter())
{
if (!GetPlayer()->HasIncreaseMountedFlightSpeedAura() && !GetPlayer()->HasFlyAura())
GetPlayer()->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_CAN_FLY);
}
if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()))
{
LOG_ERROR("network.opcode", "WORLD: failed to teleport player {} ({}) to map {} because of unknown reason!",
@@ -679,6 +686,10 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
return;
}
// old map - async processing, ignore
if (counter <= _player->GetMapChangeOrderCounter())
return;
if (!ProcessMovementInfo(movementInfo, mover, _player, recvData))
{
recvData.rfinish(); // prevent warnings spam
@@ -991,6 +1002,10 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData)
return;
}
// old map - async processing, ignore
if (counter <= _player->GetMapChangeOrderCounter())
return;
if (!ProcessMovementInfo(movementInfo, mover, _player, recvData))
return;
@@ -496,7 +496,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;
}
@@ -529,7 +529,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)
@@ -549,7 +549,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
{
WorldPacket data(MSG_PETITION_DECLINE, 8);
data << _player->GetGUID();
owner->GetSession()->SendPacket(&data);
owner->SendDirectMessage(&data);
}
}
@@ -641,7 +641,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
data << uint32(0); // there 0 ...
}
player->GetSession()->SendPacket(&data);
player->SendDirectMessage(&data);
}
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
+1 -1
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();
}
}
@@ -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)
+1 -1
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)
+6 -6
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()
@@ -1736,7 +1736,7 @@ void Map::SendObjectUpdates()
}
iter->second.BuildPacket(packet);
iter->first->GetSession()->SendPacket(&packet);
iter->first->SendDirectMessage(&packet);
packet.clear(); // clean the string
}
}
@@ -1856,7 +1856,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);
@@ -2061,7 +2061,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);
}
}
@@ -2233,7 +2233,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);
}
+1 -1
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;
}
@@ -113,7 +113,7 @@ bool ChaseMovementGenerator<T>::DispatchSplineToPosition(T* owner, float x, floa
}
owner->StopMoving();
return true;
return false;
}
if (cutPath)
@@ -134,7 +134,7 @@ bool ChaseMovementGenerator<T>::DispatchSplineToPosition(T* owner, float x, floa
init.SetWalk(walk);
init.Launch();
return false;
return true;
}
template<class T>
@@ -219,18 +219,21 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
{
i_recheckDistance.Reset(400); // Sniffed value
if (i_recalculateTravel && PositionOkay(owner, target, _movingTowards ? maxTarget : Optional<float>(), angle))
if (m_currentMode != CHASE_MODE_DISTANCING)
{
if ((owner->HasUnitState(UNIT_STATE_CHASE_MOVE) && !target->isMoving() && !mutualChase) || _range)
if (i_recalculateTravel && PositionOkay(owner, target, _movingTowards ? maxTarget : Optional<float>(), angle))
{
i_recalculateTravel = false;
i_path = nullptr;
if (cOwner)
cOwner->SetCannotReachTarget();
owner->StopMoving();
owner->SetInFront(target);
MovementInform(owner);
return true;
if ((owner->HasUnitState(UNIT_STATE_CHASE_MOVE) && !target->isMoving() && !mutualChase) || _range)
{
i_recalculateTravel = false;
i_path = nullptr;
if (cOwner)
cOwner->SetCannotReachTarget();
owner->StopMoving();
owner->SetInFront(target);
MovementInform(owner);
return true;
}
}
}
}
@@ -262,6 +265,9 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
i_leashExtensionTimer.Reset(cOwner->GetAttackTime(BASE_ATTACK));
}
if (m_currentMode == CHASE_MODE_DISTANCING)
return true;
// if the target moved, we have to consider whether to adjust
if (!_lastTargetPosition || target->GetPosition() != _lastTargetPosition.value() || mutualChase != _mutualChase || !owner->IsWithinLOSInMap(target))
{
+1 -1
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)
+5 -5
View File
@@ -374,7 +374,7 @@ void OpcodeTable::Initialize()
/*0x0F3*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER);
/*0x0F4*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER);
/*0x0F5*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER);
/*0x0F6*/ DEFINE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x0F6*/ DEFINE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x0F7*/ DEFINE_SERVER_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER);
/*0x0F8*/ DEFINE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x0F9*/ DEFINE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
@@ -1245,7 +1245,7 @@ void OpcodeTable::Initialize()
/*0x45A*/ DEFINE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x45B*/ DEFINE_HANDLER(MSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x45C*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_FORCE_PITCH_RATE_CHANGE, STATUS_NEVER);
/*0x45D*/ DEFINE_HANDLER(CMSG_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleForceSpeedChangeAck );
/*0x45D*/ DEFINE_HANDLER(CMSG_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck );
/*0x45E*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER);
/*0x45F*/ DEFINE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x460*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER);
@@ -1359,9 +1359,9 @@ void OpcodeTable::Initialize()
/*0x4CC*/ DEFINE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x4CD*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER);
/*0x4CE*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER);
/*0x4CF*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x4CF*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x4D0*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER);
/*0x4D1*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x4D1*/ DEFINE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveFlagChangeOpcode );
/*0x4D2*/ DEFINE_SERVER_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER);
/*0x4D3*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER);
/*0x4D4*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER);
@@ -1431,7 +1431,7 @@ void OpcodeTable::Initialize()
/*0x514*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER);
/*0x515*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER);
/*0x516*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER);
/*0x517*/ DEFINE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleForceSpeedChangeAck );
/*0x517*/ DEFINE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck );
/*0x518*/ DEFINE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x519*/ DEFINE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
/*0x51A*/ DEFINE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
@@ -3002,12 +3002,12 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
{
if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
uint8 attacktype = Player::GetAttackBySlot(slot);
WeaponAttackType attacktype = Player::GetAttackBySlot(slot);
if (attacktype < MAX_ATTACK)
{
target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, attacktype, !apply);
}
}
}
@@ -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);
}
}
+3 -3
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()
+4 -4
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);
}
+1 -1
View File
@@ -1824,7 +1824,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
{
if (Player const* player = unitTarget->ToPlayer())
{
if (player->GetWeaponForAttack(WeaponAttackType(BASE_ATTACK + i), true))
if (player->GetWeaponForAttack(WeaponAttackType(i), true))
{
valid = true;
break;
+5 -5
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: