FANDOM



Description

The class is used by DXNet and DXRenderer to pack data into a string, which can be sent to the server. This class also provides additional structure to packets sent which increases the ease of use when reading the data on the server-side. The byte buffer can write strings, integers and floating-point numbers currently, which also offer the same read operations, which means a packet could be structured similar to the way demonstrated below:

Send Method

DXByteBuffer *Buffer = new DXByteBuffer();
Buffer->WriteInt(10);

Buffer->WriteString(“test”);

Buffer->WriteFloat(12.34);

Read Method

int num = Buffer->ReadInt();

std::string str = Buffer->ReadString();

float fl = Buffer->ReadFloat();

Sub Components

  • Std::string
  • uint32_t

Methods

Below is a list of implemented methods, accompanied with a brief description.

Example