mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
protocol login working
This commit is contained in:
@@ -91,6 +91,9 @@ void OutputMessage::addPaddingBytes(int bytes, uint8 byte)
|
||||
|
||||
void OutputMessage::encryptRSA(int size, const std::string& key)
|
||||
{
|
||||
if(m_writePos - size < 0)
|
||||
throw NetworkException("writePos - size < 0");
|
||||
|
||||
RSA::encrypt((char*)m_buffer + m_writePos - size, size, key.c_str());
|
||||
}
|
||||
|
||||
|
@@ -229,3 +229,14 @@ void Protocol::onConnect()
|
||||
{
|
||||
callLuaField("onConnect");
|
||||
}
|
||||
|
||||
void Protocol::onRecv(const InputMessagePtr& inputMessage)
|
||||
{
|
||||
callLuaField("onRecv", inputMessage);
|
||||
}
|
||||
|
||||
void Protocol::onError(const boost::system::error_code& err)
|
||||
{
|
||||
callLuaField("onError", err.message(), true);
|
||||
disconnect();
|
||||
}
|
||||
|
@@ -54,8 +54,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void onConnect();
|
||||
virtual void onRecv(const InputMessagePtr& inputMessage) {}
|
||||
virtual void onError(const boost::system::error_code& err) {}
|
||||
virtual void onRecv(const InputMessagePtr& inputMessage);
|
||||
virtual void onError(const boost::system::error_code& err);
|
||||
|
||||
uint32 m_xteaKey[4];
|
||||
|
||||
|
Reference in New Issue
Block a user