mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
new logger
scripts are now more error prone
This commit is contained in:
@@ -40,7 +40,7 @@ void Connection::poll()
|
||||
ioService.reset();
|
||||
}
|
||||
|
||||
void Connection::connect(const std::string& host, uint16 port, const Callback& callback)
|
||||
void Connection::connect(const std::string& host, uint16 port, const SimpleCallback& callback)
|
||||
{
|
||||
m_connectCallback = callback;
|
||||
m_connectionState = CONNECTION_STATE_RESOLVING;
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
static void poll();
|
||||
|
||||
void connect(const std::string& host, uint16 port, const Callback& callback);
|
||||
void connect(const std::string& host, uint16 port, const SimpleCallback& callback);
|
||||
void setErrorCallback(const ErrorCallback& errorCallback) { m_errorCallback = errorCallback; }
|
||||
|
||||
void onTimeout(const boost::system::error_code& error);
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
private:
|
||||
ErrorCallback m_errorCallback;
|
||||
Callback m_connectCallback;
|
||||
SimpleCallback m_connectCallback;
|
||||
ConnectionState_t m_connectionState;
|
||||
|
||||
boost::asio::deadline_timer m_timer;
|
||||
|
@@ -30,14 +30,14 @@ Protocol::Protocol() :
|
||||
m_connection->setErrorCallback(boost::bind(&Protocol::onError, this, _1));
|
||||
}
|
||||
|
||||
void Protocol::connect(const std::string& host, uint16 port, const Callback& callback)
|
||||
void Protocol::connect(const std::string& host, uint16 port, const SimpleCallback& callback)
|
||||
{
|
||||
m_connection->connect(host, port, callback);
|
||||
}
|
||||
|
||||
void Protocol::onError(const boost::system::error_code& error)
|
||||
{
|
||||
logError(error.message().c_str());
|
||||
flogError("PROTOCOL ERROR: ", error.message());
|
||||
|
||||
// invalid hostname
|
||||
// connection timeouted
|
||||
|
@@ -32,7 +32,7 @@ class Protocol
|
||||
public:
|
||||
Protocol();
|
||||
|
||||
void connect(const std::string& host, uint16 port, const Callback& callback);
|
||||
void connect(const std::string& host, uint16 port, const SimpleCallback& callback);
|
||||
|
||||
virtual void onError(const boost::system::error_code& error);
|
||||
|
||||
|
Reference in New Issue
Block a user