Skip to content

Flexible Packet

FlexiblePacket is a packet that stores a packed 4 byte header which holds info on how many of what types the packet contains within

Info

NameValue
Estimated SizeSee Estimated Size

Network Structure

NameType/SizeNotes
Packed HeaderInt (0x04)See Packed Header Structure
StringsUtf[String Count]Max of 255 strings
VarintsVarint[Varint Count]Max of 4096 varints
Bools1 byte (only if any bools in header)Max of 8 booleans which are packed into one byte
FloatsFloat[Float count] (0x04 * floatCount)Max of 15 floats

Class Structure

NameTypeNotes
Packet0x18 (24 bytes)Base class
Stringsstd::vector<std::wstring> (24 bytes)Holds all strings present in the packet
Varintsstd::vector<int> (24 bytes)Holds all varints present in the packet
Booleansstd::vector<bool> (24 bytes)Holds all booleans present in the packet
Floatsstd::vector<float> (24 bytes)Holds all floats present in the packet

Packed Header Structure

Byte 0
Strings
Byte 1
Varints
Byte 2
Booleans
Byte 3
Floats
Recreation of the table I generated using BitSaber

Estimated Size

cpp
    sizeof(int) // 4 byte packed header
    + (sizeof(int) * mVarints.size() // All varints * size of int
    + strings // Length of all strings
    + (!mBools.empty()) // 1 if there are any bools
    + sizeof(float) * mFloats.size()); // All floats * size of float

Contributors

The avatar of contributor named as Dexrn ZacAttack Dexrn ZacAttack

Changelog

Contributors



Documentation page was setup by DexrnZacAttack.


Documentation is licensed under Creative Commons CC-BY 4.0 unless otherwise noted. For more info, check the NOTICE file.