4#define OPCODE_ENUM OPcodes
40 p <<
_localClient->getSocket().local_endpoint().address().to_string();
52 _thread = std::make_unique<std::thread>( [&]
60 catch (
const std::exception& e )
79 return init( address, port );
114 _debugOutput = debugOutput;
115 _localClient->toggleDebugOutput( _debugOutput );
static void SET_LOG_FUNCTION(const LOG_CBK &cbk)
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 void toggleDebugOutput(bool debugOutput) noexcept
Toggle the printing of debug information.
virtual bool connect(const string &address, U16 port)
static void LOG_PRINT(const char *msg, bool error=false)
std::unique_ptr< boost::asio::io_context::work > _work
virtual bool isConnected() const noexcept
Check connection state;.
DELEGATE< void, std::string_view, bool > LOG_CBK
boost::asio::io_context _ioService
virtual void disconnect()
Disconnect from the server.
std::unique_ptr< std::thread > _thread
static const ValueType CMSG_REQUEST_DISCONNECT
Str StringFormat(const char *fmt, Args &&...args)
string to_string(GET_PASS_TYPE< T > value)
Handle console commands that start with a forward slash.
void SetThreadName(std::string_view threadName) noexcept
boost::asio::ip::basic_resolver< boost::asio::ip::tcp, boost::asio::io_context::executor_type > tcp_resolver
static NO_INLINE void errorfn(const char *format, T &&... args)
static NO_INLINE void printfn(const char *format, T &&... args)