Otclient  14/8/2020
OutputMessage Class Reference

#include <outputmessage.h>

Inheritance diagram for OutputMessage:
Collaboration diagram for OutputMessage:

Public Types

enum  { BUFFER_MAXSIZE = 65536, MAX_STRING_LENGTH = 65536, MAX_HEADER_SIZE = 8 }
 

Public Member Functions

 OutputMessage ()
 
void reset ()
 
void setBuffer (const std::string &buffer)
 
std::string getBuffer ()
 
void addU8 (uint8 value)
 
void addU16 (uint16 value)
 
void addU32 (uint32 value)
 
void addU64 (uint64 value)
 
void addString (const std::string &buffer)
 
void addPaddingBytes (int bytes, uint8 byte=0)
 
void encryptRsa ()
 
uint16 getWritePos ()
 
uint16 getMessageSize ()
 
void setWritePos (uint16 writePos)
 
void setMessageSize (uint16 messageSize)
 
- 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

uint8getWriteBuffer ()
 
uint8getHeaderBuffer ()
 
uint8getDataBuffer ()
 
void writeChecksum ()
 
void writeMessageSize ()
 

Friends

class Protocol
 

Detailed Description

Definition at line 30 of file outputmessage.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BUFFER_MAXSIZE 
MAX_STRING_LENGTH 
MAX_HEADER_SIZE 

Definition at line 33 of file outputmessage.h.

Constructor & Destructor Documentation

◆ OutputMessage()

OutputMessage::OutputMessage ( )

Definition at line 26 of file outputmessage.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addPaddingBytes()

void OutputMessage::addPaddingBytes ( int  bytes,
uint8  byte = 0 
)

Definition at line 92 of file outputmessage.cpp.

Here is the caller graph for this function:

◆ addString()

void OutputMessage::addString ( const std::string &  buffer)

Definition at line 80 of file outputmessage.cpp.

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

◆ addU16()

void OutputMessage::addU16 ( uint16  value)

Definition at line 56 of file outputmessage.cpp.

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

◆ addU32()

void OutputMessage::addU32 ( uint32  value)

Definition at line 64 of file outputmessage.cpp.

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

◆ addU64()

void OutputMessage::addU64 ( uint64  value)

Definition at line 72 of file outputmessage.cpp.

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

◆ addU8()

void OutputMessage::addU8 ( uint8  value)

Definition at line 48 of file outputmessage.cpp.

Here is the caller graph for this function:

◆ encryptRsa()

void OutputMessage::encryptRsa ( )

Definition at line 102 of file outputmessage.cpp.

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

◆ getBuffer()

std::string OutputMessage::getBuffer ( )
inline

Definition at line 44 of file outputmessage.h.

Here is the caller graph for this function:

◆ getDataBuffer()

uint8* OutputMessage::getDataBuffer ( )
inlineprotected

Definition at line 64 of file outputmessage.h.

◆ getHeaderBuffer()

uint8* OutputMessage::getHeaderBuffer ( )
inlineprotected

Definition at line 63 of file outputmessage.h.

◆ getMessageSize()

uint16 OutputMessage::getMessageSize ( )
inline

Definition at line 56 of file outputmessage.h.

Here is the caller graph for this function:

◆ getWriteBuffer()

uint8* OutputMessage::getWriteBuffer ( )
inlineprotected

Definition at line 62 of file outputmessage.h.

◆ getWritePos()

uint16 OutputMessage::getWritePos ( )
inline

Definition at line 55 of file outputmessage.h.

Here is the caller graph for this function:

◆ reset()

void OutputMessage::reset ( )

Definition at line 31 of file outputmessage.cpp.

Here is the caller graph for this function:

◆ setBuffer()

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

Definition at line 38 of file outputmessage.cpp.

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

◆ setMessageSize()

void OutputMessage::setMessageSize ( uint16  messageSize)
inline

Definition at line 59 of file outputmessage.h.

Here is the caller graph for this function:

◆ setWritePos()

void OutputMessage::setWritePos ( uint16  writePos)
inline

Definition at line 58 of file outputmessage.h.

Here is the caller graph for this function:

◆ writeChecksum()

void OutputMessage::writeChecksum ( )
protected

Definition at line 112 of file outputmessage.cpp.

Here is the call graph for this function:

◆ writeMessageSize()

void OutputMessage::writeMessageSize ( )
protected

Definition at line 121 of file outputmessage.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ Protocol

friend class Protocol
friend

Definition at line 69 of file outputmessage.h.


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