From 12e66029252f1cdbc72d3e375ede63830642c349 Mon Sep 17 00:00:00 2001 From: Henrique Date: Mon, 30 Jul 2012 17:12:38 -0300 Subject: [PATCH] Bind connection and fix protocol recv without xtea --- src/framework/luafunctions.cpp | 3 +++ src/framework/net/protocol.cpp | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/framework/luafunctions.cpp b/src/framework/luafunctions.cpp index ddaeee95..e664d8ad 100644 --- a/src/framework/luafunctions.cpp +++ b/src/framework/luafunctions.cpp @@ -631,6 +631,9 @@ void Application::registerLuaFunctions() g_lua.bindClassStaticFunction("create", &Server::create); g_lua.bindClassMemberFunction("acceptNext", &Server::acceptNext); + // Connection + g_lua.registerClass(); + // Protocol g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return ProtocolPtr(new Protocol); }); diff --git a/src/framework/net/protocol.cpp b/src/framework/net/protocol.cpp index 90169087..6f0cc1f2 100644 --- a/src/framework/net/protocol.cpp +++ b/src/framework/net/protocol.cpp @@ -138,12 +138,6 @@ void Protocol::internalRecvData(uint8* buffer, uint16 size) g_logger.traceError("failed to decrypt message"); return; } - } else { - int size = m_inputMessage->getU16(); - if(size != m_inputMessage->getUnreadSize()) { - g_logger.traceError("invalid message size"); - return; - } } onRecv(m_inputMessage);