refactor(Core): SendDirectMessage (#23230)

This commit is contained in:
天鹭
2025-10-31 01:21:26 +08:00
committed by GitHub
parent b737fc8b59
commit a1c8e0f221
57 changed files with 236 additions and 236 deletions

View File

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