![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <LocalClient.h>
Public Member Functions | |
LocalClient (Kernel &parent) | |
![]() | |
virtual bool | sendPacket (WorldPacket &p) const |
Send a packet to the target server. | |
virtual bool | init (const string &address, U16 port) |
Init a connection to the target address:port. | |
virtual bool | connect (const string &address, U16 port) |
virtual void | disconnect () |
Disconnect from the server. | |
virtual bool | isConnected () const noexcept |
Check connection state;. | |
virtual void | toggleDebugOutput (bool debugOutput) noexcept |
Toggle the printing of debug information. | |
virtual | ~ASIO () |
![]() | |
KernelComponent (Kernel &parent) noexcept | |
virtual | ~KernelComponent ()=default |
Kernel & | parent () noexcept |
const Kernel & | parent () const noexcept |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable (NonCopyable &&)=default | |
NonCopyable & | operator= (NonCopyable &&)=default |
Private Member Functions | |
void | handlePacket (WorldPacket &p) override |
void | HandlePongOpCode (WorldPacket &p) const |
void | HandleHeartBeatOpCode (WorldPacket &p) |
void | HandleDisconnectOpCode (WorldPacket &p) |
void | HandleGeometryAppendOpCode (WorldPacket &p) |
Additional Inherited Members | |
![]() | |
using | LOG_CBK = DELEGATE< void, std::string_view, bool > |
![]() | |
static void | SET_LOG_FUNCTION (const LOG_CBK &cbk) |
static void | LOG_PRINT (const char *msg, bool error=false) |
![]() | |
ASIO () noexcept=default | |
void | close () |
virtual void | handlePacket (WorldPacket &p)=0 |
![]() | |
NonCopyable ()=default | |
~NonCopyable ()=default | |
![]() | |
boost::asio::io_context | _ioService |
std::unique_ptr< boost::asio::io_context::work > | _work |
std::unique_ptr< std::thread > | _thread |
Client_uptr | _localClient |
bool | _connected {false} |
bool | _debugOutput {true} |
string | _address |
string | _port |
![]() | |
Kernel & | _parent |
![]() | |
static LOG_CBK | s_logCBK |
Definition at line 41 of file LocalClient.h.
|
explicit |
Definition at line 13 of file LocalClient.cpp.
|
private |
Definition at line 49 of file LocalClient.cpp.
|
private |
Definition at line 57 of file LocalClient.cpp.
|
private |
nothing. Heartbeats keep us alive \:D/
Definition at line 80 of file LocalClient.cpp.
|
overrideprivatevirtual |
Define this functions to implement various packet handling (a switch statement for example) switch(p.getOpcode()) { case SMSG_XXXXX: bla bla bla break; case MSG_HEARTBEAT: break;}
Implements Divide::ASIO.
Definition at line 17 of file LocalClient.cpp.
|
private |
Definition at line 37 of file LocalClient.cpp.