mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
refactor(Core): SendDirectMessage (#23230)
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
@@ -803,7 +803,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData)
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_IGNORED, LANG_UNIVERSAL, _player, _player, GetPlayer()->GetName());
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleChannelDeclineInvite(WorldPacket& recvPacket)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -494,7 +494,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
|
||||
|
||||
// update for owner if online
|
||||
if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->ownerGuid))
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
owner->SendDirectMessage(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
|
||||
|
||||
// update for owner if online
|
||||
if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->ownerGuid))
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
owner->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
|
||||
@@ -547,7 +547,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
|
||||
{
|
||||
WorldPacket data(MSG_PETITION_DECLINE, 8);
|
||||
data << _player->GetGUID();
|
||||
owner->GetSession()->SendPacket(&data);
|
||||
owner->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
|
||||
data << uint32(0); // there 0 ...
|
||||
}
|
||||
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user