Bind connection and fix protocol recv without xtea
This commit is contained in:
parent
c969f5209f
commit
12e6602925
|
@ -631,6 +631,9 @@ void Application::registerLuaFunctions()
|
||||||
g_lua.bindClassStaticFunction<Server>("create", &Server::create);
|
g_lua.bindClassStaticFunction<Server>("create", &Server::create);
|
||||||
g_lua.bindClassMemberFunction<Server>("acceptNext", &Server::acceptNext);
|
g_lua.bindClassMemberFunction<Server>("acceptNext", &Server::acceptNext);
|
||||||
|
|
||||||
|
// Connection
|
||||||
|
g_lua.registerClass<Connection>();
|
||||||
|
|
||||||
// Protocol
|
// Protocol
|
||||||
g_lua.registerClass<Protocol>();
|
g_lua.registerClass<Protocol>();
|
||||||
g_lua.bindClassStaticFunction<Protocol>("create", []{ return ProtocolPtr(new Protocol); });
|
g_lua.bindClassStaticFunction<Protocol>("create", []{ return ProtocolPtr(new Protocol); });
|
||||||
|
|
|
@ -138,12 +138,6 @@ void Protocol::internalRecvData(uint8* buffer, uint16 size)
|
||||||
g_logger.traceError("failed to decrypt message");
|
g_logger.traceError("failed to decrypt message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
int size = m_inputMessage->getU16();
|
|
||||||
if(size != m_inputMessage->getUnreadSize()) {
|
|
||||||
g_logger.traceError("invalid message size");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onRecv(m_inputMessage);
|
onRecv(m_inputMessage);
|
||||||
|
|
Loading…
Reference in New Issue