Otclient  14/8/2020
Protocol Class Reference

#include <protocol.h>

Inheritance diagram for Protocol:
Collaboration diagram for Protocol:

Public Member Functions

 Protocol ()
 
virtual ~Protocol ()
 
void connect (const std::string &host, uint16 port)
 
void disconnect ()
 
bool isConnected ()
 
bool isConnecting ()
 
ticks_t getElapsedTicksSinceLastRead ()
 
ConnectionPtr getConnection ()
 
void setConnection (const ConnectionPtr &connection)
 
void generateXteaKey ()
 
void setXteaKey (uint32 a, uint32 b, uint32 c, uint32 d)
 
std::vector< uint32getXteaKey ()
 
void enableXteaEncryption ()
 
void enableChecksum ()
 
virtual void send (const OutputMessagePtr &outputMessage)
 
virtual void recv ()
 
ProtocolPtr asProtocol ()
 
- 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

virtual void onConnect ()
 
virtual void onRecv (const InputMessagePtr &inputMessage)
 
virtual void onError (const boost::system::error_code &err)
 

Protected Attributes

uint32 m_xteaKey [4]
 

Detailed Description

Definition at line 34 of file protocol.h.

Constructor & Destructor Documentation

◆ Protocol()

Protocol::Protocol ( )

Definition at line 28 of file protocol.cpp.

◆ ~Protocol()

Protocol::~Protocol ( )
virtual

Definition at line 35 of file protocol.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ asProtocol()

ProtocolPtr Protocol::asProtocol ( )
inline

Definition at line 60 of file protocol.h.

Here is the caller graph for this function:

◆ connect()

void Protocol::connect ( const std::string &  host,
uint16  port 
)

Definition at line 43 of file protocol.cpp.

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

◆ disconnect()

void Protocol::disconnect ( )

Definition at line 50 of file protocol.cpp.

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

◆ enableChecksum()

void Protocol::enableChecksum ( )
inline

Definition at line 55 of file protocol.h.

Here is the caller graph for this function:

◆ enableXteaEncryption()

void Protocol::enableXteaEncryption ( )
inline

Definition at line 53 of file protocol.h.

Here is the caller graph for this function:

◆ generateXteaKey()

void Protocol::generateXteaKey ( )

Definition at line 145 of file protocol.cpp.

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

◆ getConnection()

ConnectionPtr Protocol::getConnection ( )
inline

Definition at line 47 of file protocol.h.

Here is the caller graph for this function:

◆ getElapsedTicksSinceLastRead()

ticks_t Protocol::getElapsedTicksSinceLastRead ( )
inline

Definition at line 45 of file protocol.h.

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

◆ getXteaKey()

std::vector< uint32 > Protocol::getXteaKey ( )

Definition at line 163 of file protocol.cpp.

Here is the caller graph for this function:

◆ isConnected()

bool Protocol::isConnected ( )

Definition at line 58 of file protocol.cpp.

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

◆ isConnecting()

bool Protocol::isConnecting ( )

Definition at line 65 of file protocol.cpp.

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

◆ onConnect()

void Protocol::onConnect ( )
protectedvirtual

Reimplemented in ProtocolGame.

Definition at line 237 of file protocol.cpp.

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

◆ onError()

void Protocol::onError ( const boost::system::error_code &  err)
protectedvirtual

Reimplemented in ProtocolGame.

Definition at line 247 of file protocol.cpp.

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

◆ onRecv()

void Protocol::onRecv ( const InputMessagePtr inputMessage)
protectedvirtual

Reimplemented in ProtocolGame.

Definition at line 242 of file protocol.cpp.

Here is the call graph for this function:

◆ recv()

void Protocol::recv ( )
virtual

Definition at line 93 of file protocol.cpp.

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

◆ send()

void Protocol::send ( const OutputMessagePtr outputMessage)
virtual

Reimplemented in ProtocolGame.

Definition at line 72 of file protocol.cpp.

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

◆ setConnection()

void Protocol::setConnection ( const ConnectionPtr connection)
inline

Definition at line 48 of file protocol.h.

Here is the caller graph for this function:

◆ setXteaKey()

void Protocol::setXteaKey ( uint32  a,
uint32  b,
uint32  c,
uint32  d 
)

Definition at line 155 of file protocol.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_xteaKey

uint32 Protocol::m_xteaKey[4]
protected

Definition at line 67 of file protocol.h.


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