21 m_data.reserve(preallocate);
26 m_data.reserve(preallocate);
50 inline void skip(u32 count) {
54 inline void seek(u32 position) {
Definition networkpacket.h:16
void clear()
Definition networkpacket.cpp:41
std::string readRawString(u32 len)
Definition networkpacket.h:67
void skip(u32 count)
Definition networkpacket.h:50
std::string readLongString()
Definition networkpacket.cpp:204
u32 getRemainingBytes() const
Definition networkpacket.h:43
void putRawPacket(const u8 *data, u32 datasize, session_t peer_id)
Definition networkpacket.cpp:23
u16 m_command
Definition networkpacket.h:150
u32 m_read_offset
Definition networkpacket.h:149
void putRawString(std::string_view src)
Definition networkpacket.h:60
u32 getOffset() const
Read OR write offset (context-depending).
Definition networkpacket.h:41
NetworkPacket & operator>>(std::string &dst)
Definition networkpacket.cpp:82
bool hasRemainingBytes() const
Definition networkpacket.h:44
Buffer< u8 > oldForgePacket()
Definition networkpacket.cpp:510
std::vector< u8 > m_data
Definition networkpacket.h:147
u32 m_datasize
Definition networkpacket.h:148
u32 getSize() const
Definition networkpacket.h:36
void readRawString(char *dst, u32 len)
Definition networkpacket.cpp:70
void checkDataSize(u32 field_size)
Definition networkpacket.h:139
NetworkPacket(u16 command, u32 preallocate, session_t peer_id)
Definition networkpacket.h:18
NetworkPacket & operator<<(std::string_view src)
Definition networkpacket.cpp:103
void seek(u32 position)
Sets the read OR write offset (context-dependent).
Definition networkpacket.h:54
u32 checkReadOffset(u32 from_offset, u32 field_size) const
Returns from_offset + field_size on success.
Definition networkpacket.cpp:10
void putRawString(const char *src, u32 len)
Definition networkpacket.cpp:59
std::string_view getRemainingNoCopy() const
Does not advance the data read offset!
Definition networkpacket.cpp:50
u16 getCommand() const
Definition networkpacket.h:38
NetworkPacket(u16 command, u32 preallocate)
Definition networkpacket.h:23
void putLongString(std::string_view src)
Definition networkpacket.cpp:118
session_t m_peer_id
Definition networkpacket.h:151
session_t getPeerId() const
Definition networkpacket.h:37
core::vector2d< s32 > v2s32
Definition irr_v2d.h:13
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3d< s32 > v3s32
Definition irr_v3d.h:15
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
u16 session_t
Definition networkprotocol.h:27