ManaPlus
Public Member Functions
TmwAthena::MessageIn Class Reference

#include <messagein.h>

Inheritance diagram for TmwAthena::MessageIn:
Net::MessageIn

Public Member Functions

 MessageIn (const char *const data, const unsigned int length)
 
void postInit (const char *const str)
 
- Public Member Functions inherited from Net::MessageIn
virtual ~MessageIn ()
 
uint16_t readId () const
 
int getId () const
 
unsigned int getLength () const
 
unsigned int getUnreadLength () const
 
unsigned char readUInt8 (const char *const str)
 
signed char readInt8 (const char *const str)
 
int16_t readInt16 (const char *const str)
 
uint16_t readUInt16 (const char *const str)
 
int32_t readInt32 (const char *const str)
 
uint32_t readUInt32 (const char *const str)
 
int readItemId (const char *const str)
 
int64_t readInt64 (const char *const str)
 
BeingId readBeingId (const char *const str)
 
float readFloat (const char *const str)
 
void readCoordinates (uint16_t &x, uint16_t &y, uint8_t &direction, const char *const str)
 
void readCoordinatePair (uint16_t &srcX, uint16_t &srcY, uint16_t &dstX, uint16_t &dstY, const char *const str)
 
void skip (const unsigned int length, const char *const str)
 
void skipToEnd (const char *const str)
 
std::string readString (int length, const char *const dstr)
 
std::string readRawString (int length, const char *const dstr)
 
unsigned char * readBytes (int length, const char *const dstr)
 
int getVersion () const
 
int getVersionMain () const
 
int getVersionRe () const
 
int getVersionZero () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Net::MessageIn
static uint8_t fromServerDirection (const uint8_t serverDir)
 
- Protected Member Functions inherited from Net::MessageIn
 MessageIn (const char *const data, const unsigned int length)
 
- Protected Attributes inherited from Net::MessageIn
const char * mData
 
unsigned int mLength
 
unsigned int mPos
 
int mVersion
 
uint16_t mId
 
bool mIgnore
 

Detailed Description

Used for parsing an incoming message.

Definition at line 39 of file messagein.h.

Constructor & Destructor Documentation

◆ MessageIn()

TmwAthena::MessageIn::MessageIn ( const char *const  data,
const unsigned int  length 
)

Constructor.

Definition at line 35 of file messagein.cpp.

36  :
37  Net::MessageIn(data, length)
38 {
39 }
uint32_t data

Member Function Documentation

◆ postInit()

void TmwAthena::MessageIn::postInit ( const char *const  str)

Definition at line 41 of file messagein.cpp.

42 {
43  // Read the message ID
44  mId = readId();
46  DEBUGLOG2("Receive packet", 0, "MessageIn");
47  readInt16(str);
48 }
uint16_t mId
Definition: messagein.h:161
int16_t readInt16(const char *const str)
Definition: messagein.cpp:131
uint16_t readId() const
Definition: messagein.cpp:87
#define IGNOREDEBUGLOG
Definition: logger.h:48
#define DEBUGLOG2(str, pos, comment)
Definition: logger.h:42

References DEBUGLOG2, IGNOREDEBUGLOG, Net::MessageIn::mId, Net::MessageIn::readId(), and Net::MessageIn::readInt16().


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