AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "ByteBuffer.h"
Public Member Functions | |
ByteBuffer () | |
ByteBuffer (size_t reserve) | |
ByteBuffer (ByteBuffer &&buf) noexcept | |
ByteBuffer (ByteBuffer const &right)=default | |
ByteBuffer (MessageBuffer &&buffer) | |
virtual | ~ByteBuffer ()=default |
ByteBuffer & | operator= (ByteBuffer const &right) |
ByteBuffer & | operator= (ByteBuffer &&right) noexcept |
void | clear () |
template<typename T > | |
void | append (T value) |
template<typename T > | |
void | put (std::size_t pos, T value) |
ByteBuffer & | operator<< (bool value) |
ByteBuffer & | operator<< (uint8 value) |
ByteBuffer & | operator<< (uint16 value) |
ByteBuffer & | operator<< (uint32 value) |
ByteBuffer & | operator<< (uint64 value) |
ByteBuffer & | operator<< (int8 value) |
ByteBuffer & | operator<< (int16 value) |
ByteBuffer & | operator<< (int32 value) |
ByteBuffer & | operator<< (int64 value) |
ByteBuffer & | operator<< (float value) |
ByteBuffer & | operator<< (double value) |
ByteBuffer & | operator<< (std::string_view value) |
ByteBuffer & | operator<< (std::string const &str) |
ByteBuffer & | operator<< (char const *str) |
ByteBuffer & | operator>> (bool &value) |
ByteBuffer & | operator>> (uint8 &value) |
ByteBuffer & | operator>> (uint16 &value) |
ByteBuffer & | operator>> (uint32 &value) |
ByteBuffer & | operator>> (uint64 &value) |
ByteBuffer & | operator>> (int8 &value) |
ByteBuffer & | operator>> (int16 &value) |
ByteBuffer & | operator>> (int32 &value) |
ByteBuffer & | operator>> (int64 &value) |
ByteBuffer & | operator>> (float &value) |
ByteBuffer & | operator>> (double &value) |
ByteBuffer & | operator>> (std::string &value) |
uint8 & | operator[] (size_t const pos) |
uint8 const & | operator[] (size_t const pos) const |
size_t | rpos () const |
size_t | rpos (size_t rpos_) |
void | rfinish () |
size_t | wpos () const |
size_t | wpos (size_t wpos_) |
template<typename T > | |
void | read_skip () |
void | read_skip (size_t skip) |
template<typename T > | |
T | read () |
template<typename T > | |
T | read (size_t pos) const |
void | read (uint8 *dest, size_t len) |
template<size_t Size> | |
void | read (std::array< uint8, Size > &arr) |
void | readPackGUID (uint64 &guid) |
std::string | ReadCString (bool requireValidUtf8=true) |
uint32 | ReadPackedTime () |
ByteBuffer & | ReadPackedTime (uint32 &time) |
uint8 * | contents () |
uint8 const * | contents () const |
size_t | size () const |
bool | empty () const |
void | resize (size_t newsize) |
void | reserve (size_t ressize) |
void | shrink_to_fit () |
void | append (const char *src, size_t cnt) |
template<class T > | |
void | append (const T *src, size_t cnt) |
void | append (uint8 const *src, size_t cnt) |
void | append (ByteBuffer const &buffer) |
template<size_t Size> | |
void | append (std::array< uint8, Size > const &arr) |
void | appendPackXYZ (float x, float y, float z) |
void | appendPackGUID (uint64 guid) |
void | AppendPackedTime (time_t time) |
void | put (size_t pos, const uint8 *src, size_t cnt) |
void | print_storage () const |
void | textlike () const |
void | hexlike () const |
template<> | |
void | read_skip () |
template<> | |
void | read_skip () |
Static Public Attributes | |
static constexpr size_t | DEFAULT_SIZE = 0x1000 |
Protected Attributes | |
size_t | _rpos {0} |
size_t | _wpos {0} |
std::vector< uint8 > | _storage |
|
inline |
|
inline |
|
inlinenoexcept |
|
default |
ByteBuffer::ByteBuffer | ( | MessageBuffer && | buffer | ) |
|
virtualdefault |
|
inline |
References contents(), and wpos().
|
inline |
|
inline |
|
inline |
|
inline |
References EndianConvert().
Referenced by UpdateData::AddUpdateBlock(), AddonHandler::BuildAddonPacket(), UpdateData::BuildPacket(), Object::BuildValuesUpdate(), Corpse::BuildValuesUpdate(), GameObject::BuildValuesUpdate(), Unit::BuildValuesUpdate(), WorldSession::HandleCalendarGetCalendar(), WorldSession::HandleGameObjectQueryOpcode(), WorldSession::HandleRequestAccountData(), WorldSocket::HandleSendAuthSession(), WardenWin::InitializeModule(), AuthSession::LogonChallengeCallback(), lfg::LFGMgr::RBPacketBuildDifference(), lfg::LFGMgr::RBPacketBuildFull(), AuthSession::RealmListCallback(), AuthSession::ReconnectChallengeCallback(), WardenMac::RequestChecks(), WardenWin::RequestChecks(), WardenMac::RequestHash(), WardenWin::RequestHash(), Warden::RequestModule(), WorldSession::SendAddonsInfo(), Spell::SendLogExecute(), Warden::SendModuleToClient(), GmTicket::SendResponse(), Movement::WriteCatmullRomCyclicPath(), Movement::WriteCatmullRomPath(), and Movement::PacketBuilder::WriteCreate().
void ByteBuffer::append | ( | uint8 const * | src, |
size_t | cnt | ||
) |
void ByteBuffer::AppendPackedTime | ( | time_t | time | ) |
References Acore::Time::TimeBreakdown().
Referenced by AchievementMgr::BuildAllDataPacket(), CalendarEvent::BuildCalendarMailBody(), WorldSession::HandleCalendarGetCalendar(), AchievementMgr::SendAchievementEarned(), AuctionHouseMgr::SendAuctionSalePendingMail(), CalendarMgr::SendCalendarEvent(), CalendarMgr::SendCalendarEventInvite(), CalendarMgr::SendCalendarEventInviteAlert(), CalendarMgr::SendCalendarEventInviteRemoveAlert(), CalendarMgr::SendCalendarEventRemovedAlert(), CalendarMgr::SendCalendarEventStatus(), CalendarMgr::SendCalendarEventUpdateAlert(), WorldSession::SendCalendarRaidLockout(), WorldSession::SendCalendarRaidLockoutUpdated(), AchievementMgr::SendCriteriaUpdate(), Player::SendInitialPacketsBeforeAddToMap(), and WorldPackets::Guild::GuildInfoResponse::Write().
|
inline |
Referenced by AchievementMgr::BuildAllDataPacket(), Guild::MassInviteToEvent(), PackedGuid::PackedGuid(), AchievementMgr::SendCriteriaUpdate(), Player::SendEquipmentSetList(), PackedGuid::Set(), and Player::SetEquipmentSet().
|
inline |
Referenced by Movement::WriteLinearPath().
|
inline |
|
inline |
Referenced by append(), AddonHandler::BuildAddonPacket(), UpdateData::BuildPacket(), WardenWin::HandleData(), WorldSession::HandleGMTicketCreateOpcode(), WardenMac::HandleHashResult(), WardenWin::HandleHashResult(), AuthSession::HandleLogonProof(), WorldSession::HandleRequestAccountData(), WorldSession::HandleUpdateAccountData(), WorldSession::HandleWardenDataOpcode(), PacketLog::LogPacket(), WorldSession::ReadAddonsInfo(), WardenMac::RequestChecks(), AuthSession::SendPacket(), and WorldSocket::Update().
|
inline |
|
inline |
void ByteBuffer::hexlike | ( | ) | const |
References LOG_TRACE, size(), and sLog.
Referenced by debug_commandscript::HandleDebugSendOpcodeCommand(), WorldSession::HandleWardenDataOpcode(), WardenMac::RequestChecks(), and WorldSession::Update().
|
inline |
|
inline |
References operator<<().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References operator<<().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
ByteBuffer & ByteBuffer::operator>> | ( | double & | value | ) |
ByteBuffer & ByteBuffer::operator>> | ( | float & | value | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void ByteBuffer::print_storage | ( | ) | const |
References LOG_TRACE, size(), and sLog.
Referenced by WorldSession::LogUnprocessedTail().
void ByteBuffer::put | ( | size_t | pos, |
const uint8 * | src, | ||
size_t | cnt | ||
) |
|
inline |
References EndianConvert().
Referenced by BattlegroundMgr::BuildBattlegroundListPacket(), Player::BuildEnchantmentsInfoData(), UpdateData::BuildPacket(), Player::BuildPetTalentsInfoData(), Player::BuildPlayerTalentsInfoData(), AuctionListItemsDelayEvent::Execute(), WorldSession::HandleAuctionListBidderItems(), WorldSession::HandleAuctionListOwnerItemsEvent(), WorldSession::HandleCharEnum(), WorldSession::HandleGetMailList(), WorldSession::HandleQueryNextMailTime(), WorldSession::HandleRequestPartyMemberStatsOpcode(), WorldSession::HandleWhoOpcode(), Channel::List(), Guild::MassInviteToEvent(), CreatureTextLocalizer< Builder >::operator()(), Player::PetSpellInitialize(), AchievementMgr::SendAchievementEarned(), Player::SendEquipmentSetList(), Player::SendInitialSpells(), Player::SendInitWorldStates(), WorldSession::SendListInventory(), PlayerMenu::SendQuestGiverQuestList(), Player::SendQuestGiverStatusMultiple(), Player::SendRaidInfo(), PlayerSocial::SendSocialList(), WorldSession::SendStablePet(), ReputationMgr::SendState(), WorldSession::SendTrainerList(), and Spell::WriteSpellGoTargets().
|
inline |
Referenced by WorldSocket::HandleAuthSession(), WorldSession::HandleClientCastFlags(), WardenMac::HandleData(), WardenWin::HandleData(), WorldSession::HandleQuestPOIQuery(), operator>>(), WorldPackets::operator>>(), WorldPackets::LFG::LFGJoin::Read(), and AuctionHouseMgr::SendAuctionSalePendingMail().
|
inline |
References EndianConvert().
|
inline |
|
inline |
|
inline |
References read_skip().
Referenced by WorldSession::HandleAuctionListPendingSales(), WorldSession::HandleBattlefieldLeaveOpcode(), WorldSession::HandleCancelCastOpcode(), WardenWin::HandleData(), WorldSession::HandleGroupAcceptOpcode(), WorldSession::HandleGroupInviteOpcode(), WorldSession::HandleItemNameQueryOpcode(), WorldSession::HandleMailDelete(), WorldSession::HandleMailReturnToSender(), WorldSession::HandleMoveHoverAck(), WorldSession::HandleMoveKnockBackAck(), WorldSession::HandleMoveSetCanFlyAckOpcode(), WorldSession::HandleMoveSplineDoneOpcode(), WorldSession::HandleMoveWaterWalkAck(), WorldSession::HandlePageTextQueryOpcode(), WorldSession::HandlePetitionBuyOpcode(), WorldSession::HandleRepopRequestOpcode(), WorldSession::HandleSendMail(), WorldSession::HandleSetActiveVoiceChannel(), WorldSession::HandleVoiceSessionEnableOpcode(), WorldPackets::LFG::LFGJoin::Read(), and read_skip().
|
inline |
|
inline |
|
inline |
std::string ByteBuffer::ReadCString | ( | bool | requireValidUtf8 = true | ) |
References rpos(), and size().
Referenced by WorldSession::HandleMessagechatOpcode().
uint32 ByteBuffer::ReadPackedTime | ( | ) |
Referenced by WorldSession::HandleCalendarAddEvent(), WorldSession::HandleCalendarCopyEvent(), and WorldSession::HandleCalendarUpdateEvent().
|
inline |
|
inline |
Referenced by WorldSession::HandleEquipmentSetDelete(), WorldSession::HandleEquipmentSetSave(), and operator>>().
|
inline |
|
inline |
Referenced by AddonHandler::BuildAddonPacket(), UpdateData::BuildPacket(), WorldSession::HandleGMTicketCreateOpcode(), AuthSession::HandleLogonProof(), WorldSession::HandleRequestAccountData(), WorldSession::HandleUpdateAccountData(), Acore::LocalizedPacketDo< Builder >::operator()(), and WorldSession::ReadAddonsInfo().
|
inline |
Referenced by WorldSession::HandleActivateTaxiExpressOpcode(), WorldSession::HandleAuctionListBidderItems(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleCalendarAddEvent(), WorldSession::HandleCalendarCopyEvent(), WorldSession::HandleCalendarRemoveEvent(), WorldSession::HandleCalendarUpdateEvent(), WorldSession::HandleCastSpellOpcode(), WorldSession::HandleChangeSeatsOnControlledVehicle(), WorldSession::HandleCharCustomize(), WorldSession::HandleCharFactionOrRaceChange(), WardenWin::HandleData(), WorldSession::HandleDismissControlledVehicle(), WorldSession::HandleEjectPassenger(), WorldSession::HandleFeatherFallAck(), WorldSession::HandleForceSpeedChangeAck(), WorldSession::HandleGMTicketCreateOpcode(), WorldSession::HandleLearnPreviewTalents(), WorldSession::HandleLearnPreviewTalentsPet(), WorldSession::HandleMessagechatOpcode(), WorldSession::HandleMoveKnockBackAck(), WorldSession::HandleMovementOpcodes(), WorldSession::HandleMoveNotActiveMover(), WorldSession::HandleMoveRootAck(), WorldSession::HandleMoveSetCanFlyAckOpcode(), WorldSession::HandleMoveUnRootAck(), WorldSession::HandleQuestPOIQuery(), WorldSession::HandleSendMail(), WorldSession::HandleUpdateAccountData(), WorldSession::HandleUpdateMissileTrajectory(), and validUtf8String().
|
inline |
Referenced by AddonHandler::BuildAddonPacket(), WorldSocket::HandleAuthSession(), WardenWin::HandleData(), WorldSession::HandleGMTicketCreateOpcode(), WardenMac::HandleHashResult(), WardenWin::HandleHashResult(), WorldSession::HandleUpdateAccountData(), WorldSession::LogUnprocessedTail(), WorldSession::ReadAddonsInfo(), and ReadCString().
|
inline |
|
inline |
Referenced by append(), AddonHandler::BuildAddonPacket(), WorldSession::HandleAuctionListBidderItems(), WorldSocket::HandleAuthSession(), WorldSession::HandleCastSpellOpcode(), WardenWin::HandleData(), WorldSession::HandleGMTicketCreateOpcode(), WorldSession::HandleMovementOpcodes(), WorldSession::HandleMoveTimeSkippedOpcode(), WorldSession::HandleOpenItemOpcode(), WorldSession::HandlePetSetAction(), WorldSession::HandleTogglePvP(), WorldSession::HandleUpdateAccountData(), WorldSession::HandleUseItemOpcode(), WorldSession::HandleWardenDataOpcode(), hexlike(), PacketLog::LogPacket(), print_storage(), put(), WorldSession::ReadAddonsInfo(), ReadCString(), AuthSession::RealmListCallback(), WardenMac::RequestChecks(), AuthSession::SendPacket(), WorldSession::SendPacket(), PackedGuid::size(), textlike(), and WorldSocket::Update().
void ByteBuffer::textlike | ( | ) | const |
|
inline |
Referenced by append(), BattlegroundMgr::BuildBattlegroundListPacket(), ChatHandler::BuildChatPacket(), Player::BuildEnchantmentsInfoData(), UpdateData::BuildPacket(), Player::BuildPetTalentsInfoData(), Player::BuildPlayerTalentsInfoData(), WardenWin::HandleData(), WorldSession::HandleGetMailList(), WardenMac::HandleHashResult(), WardenWin::HandleHashResult(), WorldSession::HandleRequestPartyMemberStatsOpcode(), Channel::List(), WorldSession::LogUnprocessedTail(), Player::PetSpellInitialize(), AchievementMgr::SendAchievementEarned(), Player::SendEquipmentSetList(), Player::SendInitialSpells(), Player::SendInitWorldStates(), WorldSession::SendListInventory(), WorldSession::SendPacket(), PlayerMenu::SendQuestGiverQuestList(), Player::SendRaidInfo(), PlayerSocial::SendSocialList(), WorldSession::SendStablePet(), ReputationMgr::SendState(), WorldSession::SendTrainerList(), PackedGuid::Set(), and Spell::WriteSpellGoTargets().
|
protected |
Referenced by operator=().
|
protected |
Referenced by append(), WorldPacket::Initialize(), operator=(), and put().
|
protected |
Referenced by append(), and operator=().
|
staticconstexpr |