mirror of
https://github.com/edubart/otclient.git
synced 2025-12-29 02:47:12 +01:00
new script engine, and things maybe be bugged for a while
This commit is contained in:
@@ -31,19 +31,18 @@
|
||||
#include <net/outputmessage.h>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
typedef boost::function<void(boost::system::error_code&)> ErrorCallback;
|
||||
typedef boost::function<void(InputMessage*)> RecvCallback;
|
||||
typedef std::function<void(boost::system::error_code&)> ErrorCallback;
|
||||
typedef std::function<void(InputMessage*)> RecvCallback;
|
||||
|
||||
class Connection : public boost::enable_shared_from_this<Connection>, boost::noncopyable
|
||||
class Connection : public std::enable_shared_from_this<Connection>, boost::noncopyable
|
||||
{
|
||||
public:
|
||||
Connection();
|
||||
|
||||
static void poll();
|
||||
|
||||
void connect(const std::string& host, uint16 port, const boost::function<void()>& connectCallback);
|
||||
void connect(const std::string& host, uint16 port, const std::function<void()>& connectCallback);
|
||||
void send(OutputMessage *outputMessage);
|
||||
|
||||
void setErrorCallback(const ErrorCallback& errorCallback) { m_errorCallback = errorCallback; }
|
||||
@@ -66,7 +65,7 @@ public:
|
||||
private:
|
||||
ErrorCallback m_errorCallback;
|
||||
RecvCallback m_recvCallback;
|
||||
boost::function<void()> m_connectCallback;
|
||||
std::function<void()> m_connectCallback;
|
||||
ConnectionState_t m_connectionState;
|
||||
|
||||
boost::asio::deadline_timer m_timer;
|
||||
@@ -76,6 +75,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Connection> ConnectionPtr;
|
||||
typedef std::shared_ptr<Connection> ConnectionPtr;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user