mirror of
https://github.com/edubart/otclient.git
synced 2025-12-29 02:47:12 +01:00
many changes and refactoring
This commit is contained in:
@@ -25,10 +25,13 @@
|
||||
#ifndef CONNECTION_H
|
||||
#define CONNECTION_H
|
||||
|
||||
#include <global.h>
|
||||
|
||||
#include <net/inputmessage.h>
|
||||
#include <net/outputmessage.h>
|
||||
#include <prerequisites.h>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
typedef boost::function<void(boost::system::error_code&)> ErrorCallback;
|
||||
typedef boost::function<void(InputMessage*)> RecvCallback;
|
||||
@@ -40,7 +43,7 @@ public:
|
||||
|
||||
static void poll();
|
||||
|
||||
void connect(const std::string& host, uint16 port, const SimpleCallback& connectCallback);
|
||||
void connect(const std::string& host, uint16 port, const boost::function<void()>& connectCallback);
|
||||
void send(OutputMessage *outputMessage);
|
||||
|
||||
void setErrorCallback(const ErrorCallback& errorCallback) { m_errorCallback = errorCallback; }
|
||||
@@ -63,7 +66,7 @@ public:
|
||||
private:
|
||||
ErrorCallback m_errorCallback;
|
||||
RecvCallback m_recvCallback;
|
||||
SimpleCallback m_connectCallback;
|
||||
boost::function<void()> m_connectCallback;
|
||||
ConnectionState_t m_connectionState;
|
||||
|
||||
boost::asio::deadline_timer m_timer;
|
||||
|
||||
Reference in New Issue
Block a user