mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
refactor(Core): SendDirectMessage (#23230)
This commit is contained in:
@@ -433,7 +433,7 @@ public:
|
||||
}
|
||||
|
||||
data.hexlike();
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ public:
|
||||
uint32 queueSlot = 0;
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType(), teamId);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
|
||||
// Remove from LFG queues
|
||||
sLFGMgr->LeaveAllLfgQueues(player->GetGUID(), false);
|
||||
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
data << uint8(op);
|
||||
data << uint16(val);
|
||||
data << uint16(mark ? *mark : 65535);
|
||||
target->GetSession()->SendPacket(&data);
|
||||
target->SendDirectMessage(&data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
{
|
||||
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
||||
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
||||
submitter->GetSession()->SendPacket(&data);
|
||||
submitter->SendDirectMessage(&data);
|
||||
ChatHandler(submitter->GetSession()).SendSysMessage(LANG_TICKET_CLOSED);
|
||||
}
|
||||
return true;
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
// Force abandon ticket
|
||||
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
||||
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -382,7 +382,7 @@ class spell_madrigosa_activate_barrier : public SpellScript
|
||||
WorldPacket pkt;
|
||||
go->BuildValuesUpdateBlockForPlayer(&data, player);
|
||||
data.BuildPacket(pkt);
|
||||
player->GetSession()->SendPacket(&pkt);
|
||||
player->SendDirectMessage(&pkt);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -409,7 +409,7 @@ class spell_madrigosa_deactivate_barrier : public SpellScript
|
||||
WorldPacket pkt;
|
||||
go->BuildValuesUpdateBlockForPlayer(&data, player);
|
||||
data.BuildPacket(pkt);
|
||||
player->GetSession()->SendPacket(&pkt);
|
||||
player->SendDirectMessage(&pkt);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
|
||||
WorldPacket data(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, 4);
|
||||
data << uint32(ENCOUNTER_FRAME_REFRESH_FRAMES);
|
||||
_owner->GetSession()->SendPacket(&data);
|
||||
_owner->SendDirectMessage(&data);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
data << uint32(VEHICLE_SPELL_RIDE_HARDCODED);
|
||||
data << uint8(SPELL_FAILED_CUSTOM_ERROR);
|
||||
data << uint32(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
|
||||
clicker->ToPlayer()->GetSession()->SendPacket(&data);
|
||||
clicker->ToPlayer()->SendDirectMessage(&data);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2272,7 +2272,7 @@ class spell_igb_overheat_aura : public AuraScript
|
||||
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, GetUnitOwner()->GetPackGUID().size() + 1);
|
||||
data << GetUnitOwner()->GetPackGUID();
|
||||
data << uint8(value);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ void SendPacketToPlayers(WorldPacket const* data, Unit* source)
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetAreaId() == AREA_THE_FROZEN_THRONE)
|
||||
player->GetSession()->SendPacket(data);
|
||||
player->SendDirectMessage(data);
|
||||
}
|
||||
|
||||
struct ShadowTrapLKTargetSelector
|
||||
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
data << spellId;
|
||||
data << uint8(SPELL_FAILED_CUSTOM_ERROR);
|
||||
data << uint32(SPELL_CUSTOM_ERROR_CANT_BUILD_MORE_VEHICLES);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -567,9 +567,9 @@ struct npc_pet_gen_imp_in_a_bottle : public NullCreatureAI
|
||||
for (GroupReference* itr = player->GetGroup()->GetFirstMember(); itr != nullptr && limit < 4; itr = itr->next(), ++limit)
|
||||
if (Player* groupPlayer = itr->GetSource())
|
||||
if (groupPlayer != player)
|
||||
groupPlayer->GetSession()->SendPacket(&_data);
|
||||
groupPlayer->SendDirectMessage(&_data);
|
||||
|
||||
player->GetSession()->SendPacket(&_data);
|
||||
player->SendDirectMessage(&_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1970,7 +1970,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScript
|
||||
{
|
||||
WorldPacket data;
|
||||
player->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_INCLUDE_GCD, 7744, GetSpellInfo()->CategoryRecoveryTime); // Will of the forsaken
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1983,11 +1983,11 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScript
|
||||
data << uint16(GetSpellInfo()->GetCategory()); // spell category
|
||||
data << uint32(0);
|
||||
data << uint32(GetSpellInfo()->CategoryRecoveryTime);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
|
||||
WorldPacket data2;
|
||||
player->BuildCooldownPacket(data2, SPELL_COOLDOWN_FLAG_INCLUDE_GCD, SPELL_PVP_TRINKET, GetSpellInfo()->CategoryRecoveryTime); // PvP Trinket spell
|
||||
player->GetSession()->SendPacket(&data2);
|
||||
player->SendDirectMessage(&data2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2650,7 +2650,7 @@ class spell_gen_spirit_healer_res : public SpellScript
|
||||
{
|
||||
WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
|
||||
data << target->GetGUID();
|
||||
originalCaster->GetSession()->SendPacket(&data);
|
||||
originalCaster->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user