33#ifndef DVD_DIVIDE_BOOST_ASIO_TPL_H_
34#define DVD_DIVIDE_BOOST_ASIO_TPL_H_
44 "Please include 'OPCodesTpl' and define custom OPcodes before using the networking library!"
55 virtual bool init(
const string& address,
U16 port );
58 virtual bool connect(
const string& address,
U16 port );
69 static void LOG_PRINT(
const char* msg,
bool error =
false );
87 std::unique_ptr<boost::asio::io_context::work>
_work;
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 void handlePacket(WorldPacket &p)=0
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
Handle console commands that start with a forward slash.
DELEGATE_STD< Ret, Args... > DELEGATE