Otclient  14/8/2020
InputMessage Class Reference

#include <inputmessage.h>

Inheritance diagram for InputMessage:
Collaboration diagram for InputMessage:

Public Types

enum  { BUFFER_MAXSIZE = 65536, MAX_HEADER_SIZE = 8 }
 

Public Member Functions

 InputMessage ()
 
void setBuffer (const std::string &buffer)
 
std::string getBuffer ()
 
void skipBytes (uint16 bytes)
 
void setReadPos (uint16 readPos)
 
uint8 getU8 ()
 
uint16 getU16 ()
 
uint32 getU32 ()
 
uint64 getU64 ()
 
std::string getString ()
 
double getDouble ()
 
uint8 peekU8 ()
 
uint16 peekU16 ()
 
uint32 peekU32 ()
 
uint64 peekU64 ()
 
bool decryptRsa (int size)
 
int getReadSize ()
 
int getReadPos ()
 
int getUnreadSize ()
 
uint16 getMessageSize ()
 
bool eof ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

void reset ()
 
void fillBuffer (uint8 *buffer, uint16 size)
 
void setHeaderSize (uint16 size)
 
void setMessageSize (uint16 size)
 
uint8getReadBuffer ()
 
uint8getHeaderBuffer ()
 
uint8getDataBuffer ()
 
uint16 getHeaderSize ()
 
uint16 readSize ()
 
bool readChecksum ()
 

Friends

class Protocol
 

Detailed Description

Definition at line 30 of file inputmessage.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BUFFER_MAXSIZE 
MAX_HEADER_SIZE 

Definition at line 33 of file inputmessage.h.

Constructor & Destructor Documentation

◆ InputMessage()

InputMessage::InputMessage ( )

Definition at line 26 of file inputmessage.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ decryptRsa()

bool InputMessage::decryptRsa ( int  size)

Definition at line 96 of file inputmessage.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eof()

bool InputMessage::eof ( )
inline

Definition at line 64 of file inputmessage.h.

Here is the caller graph for this function:

◆ fillBuffer()

void InputMessage::fillBuffer ( uint8 buffer,
uint16  size 
)
protected

Definition at line 103 of file inputmessage.cpp.

◆ getBuffer()

std::string InputMessage::getBuffer ( )
inline

Definition at line 41 of file inputmessage.h.

Here is the caller graph for this function:

◆ getDataBuffer()

uint8* InputMessage::getDataBuffer ( )
inlineprotected

Definition at line 75 of file inputmessage.h.

◆ getDouble()

double InputMessage::getDouble ( )

Definition at line 89 of file inputmessage.cpp.

Here is the call graph for this function:

◆ getHeaderBuffer()

uint8* InputMessage::getHeaderBuffer ( )
inlineprotected

Definition at line 74 of file inputmessage.h.

◆ getHeaderSize()

uint16 InputMessage::getHeaderSize ( )
inlineprotected

Definition at line 76 of file inputmessage.h.

◆ getMessageSize()

uint16 InputMessage::getMessageSize ( )
inline

Definition at line 62 of file inputmessage.h.

Here is the caller graph for this function:

◆ getReadBuffer()

uint8* InputMessage::getReadBuffer ( )
inlineprotected

Definition at line 73 of file inputmessage.h.

◆ getReadPos()

int InputMessage::getReadPos ( )
inline

Definition at line 60 of file inputmessage.h.

◆ getReadSize()

int InputMessage::getReadSize ( )
inline

Definition at line 59 of file inputmessage.h.

Here is the caller graph for this function:

◆ getString()

std::string InputMessage::getString ( )

Definition at line 80 of file inputmessage.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU16()

uint16 InputMessage::getU16 ( )

Definition at line 56 of file inputmessage.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU32()

uint32 InputMessage::getU32 ( )

Definition at line 64 of file inputmessage.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU64()

uint64 InputMessage::getU64 ( )

Definition at line 72 of file inputmessage.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getU8()

uint8 InputMessage::getU8 ( )

Definition at line 48 of file inputmessage.cpp.

Here is the caller graph for this function:

◆ getUnreadSize()

int InputMessage::getUnreadSize ( )
inline

Definition at line 61 of file inputmessage.h.

Here is the caller graph for this function:

◆ peekU16()

uint16 InputMessage::peekU16 ( )
inline

Definition at line 53 of file inputmessage.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ peekU32()

uint32 InputMessage::peekU32 ( )
inline

Definition at line 54 of file inputmessage.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ peekU64()

uint64 InputMessage::peekU64 ( )
inline

Definition at line 55 of file inputmessage.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ peekU8()

uint8 InputMessage::peekU8 ( )
inline

Definition at line 52 of file inputmessage.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readChecksum()

bool InputMessage::readChecksum ( )
protected

Definition at line 117 of file inputmessage.cpp.

Here is the call graph for this function:

◆ readSize()

uint16 InputMessage::readSize ( )
inlineprotected

Definition at line 78 of file inputmessage.h.

Here is the call graph for this function:

◆ reset()

void InputMessage::reset ( )
protected

Definition at line 31 of file inputmessage.cpp.

Here is the caller graph for this function:

◆ setBuffer()

void InputMessage::setBuffer ( const std::string &  buffer)

Definition at line 38 of file inputmessage.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHeaderSize()

void InputMessage::setHeaderSize ( uint16  size)
protected

Definition at line 110 of file inputmessage.cpp.

Here is the caller graph for this function:

◆ setMessageSize()

void InputMessage::setMessageSize ( uint16  size)
inlineprotected

Definition at line 71 of file inputmessage.h.

◆ setReadPos()

void InputMessage::setReadPos ( uint16  readPos)
inline

Definition at line 44 of file inputmessage.h.

◆ skipBytes()

void InputMessage::skipBytes ( uint16  bytes)
inline

Definition at line 43 of file inputmessage.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Protocol

friend class Protocol
friend

Definition at line 81 of file inputmessage.h.


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