Mana
Loading...
Searching...
No Matches
Public Member Functions | Static Private Member Functions | List of all members
TmwAthena::MessageOut Class Reference

Used for building an outgoing message to eAthena. More...

#include <messageout.h>

Public Member Functions

 MessageOut (uint16_t id)
 
void writeInt8 (uint8_t value)
 Writes an unsigned 8-bit integer to the message.
 
void writeInt16 (uint16_t value)
 Writes an unsigned 16-bit integer to the message.
 
void writeInt32 (uint32_t value)
 Writes an unsigned 32-bit integer to the message.
 
void writeString (const std::string &string, int length=-1)
 Writes a string.
 
void writeCoordinates (uint16_t x, uint16_t y, uint8_t direction)
 Encodes coordinates and direction in 3 bytes.
 

Static Private Member Functions

static char * expand (size_t size)
 Expand the packet data to be able to hold more data.
 

Detailed Description

Used for building an outgoing message to eAthena.

Definition at line 34 of file messageout.h.

Constructor & Destructor Documentation

◆ MessageOut()

TmwAthena::MessageOut::MessageOut ( uint16_t  id)

Definition at line 34 of file messageout.cpp.

Member Function Documentation

◆ expand()

char * TmwAthena::MessageOut::expand ( size_t  size)
staticprivate

Expand the packet data to be able to hold more data.

Returns a pointer to the start of the new data.

Definition at line 42 of file messageout.cpp.

◆ writeCoordinates()

void TmwAthena::MessageOut::writeCoordinates ( uint16_t  x,
uint16_t  y,
uint8_t  direction 
)

Encodes coordinates and direction in 3 bytes.

Definition at line 94 of file messageout.cpp.

◆ writeInt16()

void TmwAthena::MessageOut::writeInt16 ( uint16_t  value)

Writes an unsigned 16-bit integer to the message.

Definition at line 55 of file messageout.cpp.

◆ writeInt32()

void TmwAthena::MessageOut::writeInt32 ( uint32_t  value)

Writes an unsigned 32-bit integer to the message.

Definition at line 61 of file messageout.cpp.

◆ writeInt8()

void TmwAthena::MessageOut::writeInt8 ( uint8_t  value)

Writes an unsigned 8-bit integer to the message.

Definition at line 50 of file messageout.cpp.

◆ writeString()

void TmwAthena::MessageOut::writeString ( const std::string &  string,
int  length = -1 
)

Writes a string.

If a fixed length is not given (-1), it is stored as a short at the start of the string.

Definition at line 67 of file messageout.cpp.


The documentation for this class was generated from the following files: