![]() |
TrinityCore
|
#include <ByteBuffer.h>
Inheritance diagram for ByteBuffer:Public Member Functions | |
| ByteBuffer () | |
| ByteBuffer (size_t reserve) | |
| ByteBuffer (ByteBuffer &&buf) noexcept | |
| ByteBuffer (ByteBuffer const &right)=default | |
| ByteBuffer (MessageBuffer &&buffer) | |
| std::vector< uint8 > && | Move () |
| ByteBuffer & | operator= (ByteBuffer const &right) |
| ByteBuffer & | operator= (ByteBuffer &&right) noexcept |
| virtual | ~ByteBuffer ()=default |
| 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) |
| 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 | 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 |
| size_t | _wpos |
| std::vector< uint8 > | _storage |
Definition at line 69 of file ByteBuffer.h.
|
inline |
Definition at line 75 of file ByteBuffer.h.
|
inline |
Definition at line 80 of file ByteBuffer.h.
|
inlinenoexcept |
Definition at line 85 of file ByteBuffer.h.
|
default |
| ByteBuffer::ByteBuffer | ( | MessageBuffer && | buffer | ) |
Definition at line 28 of file ByteBuffer.cpp.
|
virtualdefault |
|
inline |
Definition at line 446 of file ByteBuffer.h.
References contents(), and wpos().
|
inline |
Definition at line 434 of file ByteBuffer.h.
|
inline |
Definition at line 439 of file ByteBuffer.h.
|
inline |
Definition at line 453 of file ByteBuffer.h.
|
inline |
Definition at line 133 of file ByteBuffer.h.
References EndianConvert().
Referenced by PlayerTaxi::AppendTaximaskTo(), UpdateMaskPacketBuilder::AppendToPacket(), UpdateData::BuildPacket(), Object::BuildValuesUpdate(), GameObject::BuildValuesUpdate(), Unit::BuildValuesUpdate(), WorldSession::HandleQuestPOIQuery(), WardenWin::InitializeModule(), AuthSession::LogonChallengeCallback(), DefenseMessageBuilder::operator()(), WorldPackets::Inspect::operator<<(), WorldPackets::Spells::operator<<(), operator<<(), AuthSession::RealmListCallback(), AuthSession::ReconnectChallengeCallback(), WardenMac::RequestChecks(), WardenWin::RequestChecks(), WardenMac::RequestHash(), WardenWin::RequestHash(), Warden::RequestModule(), Spell::SendLogExecute(), Warden::SendModuleToClient(), GmTicket::SendResponse(), WorldPackets::Auth::AuthChallenge::Write(), WorldPackets::ClientConfig::AddonInfo::Write(), WorldPackets::ClientConfig::UpdateAccountData::Write(), WorldPackets::Misc::TutorialFlags::Write(), WorldPackets::NPC::TrainerList::Write(), WorldPackets::Spells::UpdateActionButtons::Write(), and WorldPackets::Movement::CommonMovement::WriteCreateObjectSplineDataBlock().
| void ByteBuffer::append | ( | uint8 const * | src, |
| size_t | cnt | ||
| ) |
|
inline |
Definition at line 468 of file ByteBuffer.h.
Referenced by operator<<(), WorldPackets::Achievement::operator<<(), WorldPackets::Achievement::CriteriaUpdate::Write(), and WorldPackets::EquipmentSet::EquipmentSetID::Write().
|
inline |
Definition at line 459 of file ByteBuffer.h.
Referenced by operator<<().
|
inline |
Definition at line 126 of file ByteBuffer.h.
Referenced by UpdateData::Clear(), WorldSession::HandleCharEnum(), WorldPacket::Initialize(), Map::SendInitSelf(), Map::SendObjectUpdates(), and Player::SetViewpoint().
|
inline |
Definition at line 399 of file ByteBuffer.h.
Referenced by append(), UpdateData::BuildPacket(), WardenWin::HandleCheckResult(), Warden::HandleData(), WorldSession::HandleGMTicketCreateOpcode(), PacketLog::LogPacket(), WorldPackets::ClientConfig::UserClientUpdateAccountData::Read(), WorldSession::ReadAddonsInfo(), WardenMac::RequestChecks(), WardenWin::RequestChecks(), AuthSession::SendPacket(), and WorldSocket::Update().
|
inline |
Definition at line 406 of file ByteBuffer.h.
|
inline |
Definition at line 414 of file ByteBuffer.h.
Referenced by UpdateData::BuildPacket(), WorldSession::HandleRaidReadyCheckOpcode(), WorldSession::HandleWardenDataOpcode(), PacketLog::LogPacket(), AuthSession::SendPacket(), and WorldSocket::Update().
| void ByteBuffer::hexlike | ( | ) | const |
Definition at line 155 of file ByteBuffer.cpp.
References LOG_LEVEL_TRACE, size(), sLog, and TC_LOG_TRACE.
Referenced by Warden::HandleData(), debug_commandscript::HandleDebugSendOpcodeCommand(), WardenMac::RequestChecks(), WardenWin::RequestChecks(), and WorldSession::Update().
|
inline |
Definition at line 93 of file ByteBuffer.h.
|
inline |
Definition at line 148 of file ByteBuffer.h.
|
inline |
Definition at line 229 of file ByteBuffer.h.
References operator<<().
|
inline |
Definition at line 210 of file ByteBuffer.h.
|
inline |
Definition at line 204 of file ByteBuffer.h.
|
inline |
Definition at line 185 of file ByteBuffer.h.
|
inline |
Definition at line 191 of file ByteBuffer.h.
|
inline |
Definition at line 197 of file ByteBuffer.h.
|
inline |
Definition at line 179 of file ByteBuffer.h.
|
inline |
Definition at line 224 of file ByteBuffer.h.
References operator<<().
|
inline |
Definition at line 216 of file ByteBuffer.h.
|
inline |
Definition at line 160 of file ByteBuffer.h.
|
inline |
Definition at line 166 of file ByteBuffer.h.
|
inline |
Definition at line 172 of file ByteBuffer.h.
|
inline |
Definition at line 154 of file ByteBuffer.h.
|
inlinenoexcept |
Definition at line 112 of file ByteBuffer.h.
References _rpos.
|
inline |
Definition at line 100 of file ByteBuffer.h.
|
inline |
Definition at line 234 of file ByteBuffer.h.
| ByteBuffer & ByteBuffer::operator>> | ( | double & | value | ) |
Definition at line 67 of file ByteBuffer.cpp.
| ByteBuffer & ByteBuffer::operator>> | ( | float & | value | ) |
Definition at line 59 of file ByteBuffer.cpp.
|
inline |
Definition at line 271 of file ByteBuffer.h.
|
inline |
Definition at line 277 of file ByteBuffer.h.
|
inline |
Definition at line 283 of file ByteBuffer.h.
|
inline |
Definition at line 265 of file ByteBuffer.h.
|
inline |
Definition at line 292 of file ByteBuffer.h.
|
inline |
Definition at line 246 of file ByteBuffer.h.
|
inline |
Definition at line 252 of file ByteBuffer.h.
|
inline |
Definition at line 258 of file ByteBuffer.h.
|
inline |
Definition at line 240 of file ByteBuffer.h.
|
inline |
Definition at line 298 of file ByteBuffer.h.
|
inline |
Definition at line 305 of file ByteBuffer.h.
| void ByteBuffer::print_storage | ( | ) | const |
Definition at line 124 of file ByteBuffer.cpp.
References LOG_LEVEL_TRACE, size(), sLog, and TC_LOG_TRACE.
Referenced by WorldSession::LogUnprocessedTail().
| void ByteBuffer::put | ( | size_t | pos, |
| const uint8 * | src, | ||
| size_t | cnt | ||
| ) |
|
inline |
Definition at line 141 of file ByteBuffer.h.
References EndianConvert().
Referenced by UpdateData::BuildPacket(), WorldSession::HandleAuctionListBidderItems(), WorldSession::HandleAuctionListItems(), WorldSession::HandleAuctionListOwnerItems(), WorldSession::HandleCharEnum(), WorldSession::HandleRequestPartyMemberStatsOpcode(), Group::MasterLoot(), CreatureTextLocalizer< Builder >::operator()(), Player::PetSpellInitialize(), Player::SendInitialPacketsAfterAddToMap(), PlayerMenu::SendQuestGiverQuestList(), Player::SendRaidInfo(), WorldSession::SendStablePet(), ReputationMgr::SendState(), and WorldPackets::Mail::MailListResult::Write().
|
inline |
Definition at line 343 of file ByteBuffer.h.
Referenced by WorldSocket::HandleAuthSession(), WardenMac::HandleCheckResult(), WardenWin::HandleCheckResult(), WorldSession::HandleClientCastFlags(), WardenMac::HandleHashResult(), WardenWin::HandleHashResult(), WorldSession::HandleUpdateMissileTrajectory(), operator>>(), WorldPackets::Spells::operator>>(), WorldPackets::Spells::operator>>(), WorldPackets::Who::operator>>(), WorldPackets::Chat::ChatMessage::Read(), WorldPackets::LFG::LFGJoin::Read(), WorldPackets::Talent::LearnPreviewTalents::Read(), and WorldSession::ReadAddonsInfo().
|
inline |
Definition at line 350 of file ByteBuffer.h.
References EndianConvert().
|
inline |
Definition at line 368 of file ByteBuffer.h.
|
inline |
Definition at line 359 of file ByteBuffer.h.
|
inline |
Definition at line 334 of file ByteBuffer.h.
References read_skip().
Referenced by WorldSession::HandleAuctionListItems(), WorldSession::HandleAuctionListPendingSales(), WardenWin::HandleCheckResult(), WorldSession::HandleFeatherFallAck(), WorldSession::HandleGroupAcceptOpcode(), WorldSession::HandleItemNameQueryOpcode(), WorldSession::HandleMoveGravityDisableAck(), WorldSession::HandleMoveGravityEnableAck(), WorldSession::HandleMoveHoverAck(), WorldSession::HandleMoveKnockBackAck(), WorldSession::HandleMoveRootAck(), WorldSession::HandleMoveSetCanFlyAckOpcode(), WorldSession::HandleMoveSetCanTransitionBetweenSwinAndFlyAck(), WorldSession::HandleMoveSetCollisionHgtAck(), WorldSession::HandleMoveSplineDoneOpcode(), WorldSession::HandleMoveUnRootAck(), WorldSession::HandleMoveWaterWalkAck(), WorldSession::HandlePetitionBuyOpcode(), WorldSession::HandleSetActiveVoiceChannel(), WorldSession::HandleVoiceSessionEnableOpcode(), WorldPackets::Spells::operator>>(), WorldPackets::LFG::LFGJoin::Read(), and read_skip().
|
inline |
Definition at line 509 of file ByteBuffer.h.
|
inline |
Definition at line 516 of file ByteBuffer.h.
|
inline |
Definition at line 336 of file ByteBuffer.h.
| std::string ByteBuffer::ReadCString | ( | bool | requireValidUtf8 = true | ) |
Definition at line 75 of file ByteBuffer.cpp.
References rpos(), and size().
Referenced by WorldPackets::Chat::ChatMessage::Read().
|
inline |
Definition at line 373 of file ByteBuffer.h.
Referenced by WorldSession::HandleEquipmentSetDelete(), and operator>>().
|
inline |
|
inline |
Definition at line 416 of file ByteBuffer.h.
Referenced by UpdateData::BuildPacket(), WorldSession::HandleGMTicketCreateOpcode(), Trinity::LocalizedPacketDo< Builder >::operator()(), and WorldSession::ReadAddonsInfo().
|
inline |
Definition at line 320 of file ByteBuffer.h.
Referenced by WorldSession::HandleActivateTaxiExpressOpcode(), WorldSession::HandleAuctionListBidderItems(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleChangeSeatsOnControlledVehicle(), WardenWin::HandleCheckResult(), WorldSession::HandleEjectPassenger(), WorldSession::HandleFeatherFallAck(), WorldSession::HandleForceSpeedChangeAck(), WorldSession::HandleGMTicketCreateOpcode(), WorldSession::HandleGossipSelectOptionOpcode(), WorldSession::HandleLearnPreviewTalentsPet(), WorldSession::HandleMoveGravityDisableAck(), WorldSession::HandleMoveGravityEnableAck(), WorldSession::HandleMoveHoverAck(), WorldSession::HandleMoveKnockBackAck(), WorldSession::HandleMoveNotActiveMover(), WorldSession::HandleMoveRootAck(), WorldSession::HandleMoveSetCanFlyAckOpcode(), WorldSession::HandleMoveSetCanTransitionBetweenSwinAndFlyAck(), WorldSession::HandleMoveSetCollisionHgtAck(), WorldSession::HandleMoveSplineDoneOpcode(), WorldSession::HandleMoveTimeSkippedOpcode(), WorldSession::HandleMoveUnRootAck(), WorldSession::HandleMoveWaterWalkAck(), and WorldSession::HandleUpdateMissileTrajectory().
|
inline |
Definition at line 312 of file ByteBuffer.h.
Referenced by WorldSocket::HandleAuthSession(), WardenWin::HandleCheckResult(), WorldSession::HandleGMTicketCreateOpcode(), WorldSession::LogUnprocessedTail(), WorldPackets::ClientConfig::UserClientUpdateAccountData::Read(), WorldSession::ReadAddonsInfo(), and ReadCString().
|
inline |
Definition at line 314 of file ByteBuffer.h.
|
inline |
Definition at line 429 of file ByteBuffer.h.
|
inline |
Definition at line 413 of file ByteBuffer.h.
Referenced by append(), WorldSession::HandleAuctionListBidderItems(), WorldSocket::HandleAuthSession(), WardenWin::HandleCheckResult(), Warden::HandleData(), WorldSession::HandleGMTicketCreateOpcode(), WorldSession::HandleMoveTimeSkippedOpcode(), WorldSession::HandleOpenItemOpcode(), WorldSession::HandlePetSetAction(), WorldSession::HandleUseItemOpcode(), hexlike(), PacketLog::LogPacket(), print_storage(), put(), WorldPackets::ClientConfig::UserClientUpdateAccountData::Read(), WorldSession::ReadAddonsInfo(), ReadCString(), AuthSession::RealmListCallback(), WardenMac::RequestChecks(), WardenWin::RequestChecks(), Player::SendInitialPacketsAfterAddToMap(), AuthSession::SendPacket(), WorldSession::SendPacket(), GmTicket::SendResponse(), textlike(), and WorldSocket::Update().
| void ByteBuffer::textlike | ( | ) | const |
Definition at line 138 of file ByteBuffer.cpp.
References LOG_LEVEL_TRACE, size(), sLog, and TC_LOG_TRACE.
|
inline |
Definition at line 325 of file ByteBuffer.h.
Referenced by append(), UpdateData::BuildPacket(), WorldSession::HandleRequestPartyMemberStatsOpcode(), WorldSession::LogUnprocessedTail(), Player::PetSpellInitialize(), WorldSession::SendPacket(), PlayerMenu::SendQuestGiverQuestList(), Player::SendRaidInfo(), WorldSession::SendStablePet(), and ReputationMgr::SendState().
|
inline |
Definition at line 327 of file ByteBuffer.h.
|
protected |
Definition at line 496 of file ByteBuffer.h.
Referenced by operator=(), and operator=().
|
protected |
Definition at line 497 of file ByteBuffer.h.
Referenced by append(), WorldPacket::Initialize(), operator=(), and put().
|
protected |
Definition at line 496 of file ByteBuffer.h.
Referenced by append(), and operator=().
|
staticconstexpr |
Definition at line 72 of file ByteBuffer.h.