From 4590c1b894772731ae8ab26fd50e572041132189 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Fri, 13 Jan 2012 00:07:14 -0200 Subject: [PATCH] move network lua bindings to the correct place --- src/framework/luafunctions.cpp | 11 +++++++++++ src/otclient/luafunctions.cpp | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/framework/luafunctions.cpp b/src/framework/luafunctions.cpp index 24dd31fe..cd06237c 100644 --- a/src/framework/luafunctions.cpp +++ b/src/framework/luafunctions.cpp @@ -323,8 +323,19 @@ void Application::registerLuaFunctions() g_lua.bindClassStaticFunction("create", []{ return UIFrameCounterPtr(new UIFrameCounter); } ); g_lua.bindClassMemberFunction("getFrameCount", &UIFrameCounter::getFrameCount); + // OutputMessage + g_lua.registerClass(); + g_lua.bindClassStaticFunction("new", []{ return OutputMessagePtr(new OutputMessage); }); + g_lua.bindClassMemberFunction("reset", &OutputMessage::reset); + g_lua.bindClassMemberFunction("addU8", &OutputMessage::addU8); + g_lua.bindClassMemberFunction("addU16", &OutputMessage::addU16); + g_lua.bindClassMemberFunction("addU32", &OutputMessage::addU32); + g_lua.bindClassMemberFunction("addU64", &OutputMessage::addU64); + g_lua.bindClassMemberFunction("addString", (void(OutputMessage::*)(const std::string&))&OutputMessage::addString); + // Protocol g_lua.registerClass(); + g_lua.bindClassStaticFunction("send", [](const ProtocolPtr proto, OutputMessagePtr msg) { proto->send(*msg.get()); }); // Application g_lua.registerStaticClass("g_app"); diff --git a/src/otclient/luafunctions.cpp b/src/otclient/luafunctions.cpp index cb0d9261..4a7037e0 100644 --- a/src/otclient/luafunctions.cpp +++ b/src/otclient/luafunctions.cpp @@ -89,18 +89,6 @@ void OTClient::registerLuaFunctions() g_lua.registerClass(); - g_lua.registerClass(); - g_lua.bindClassStaticFunction("new", []{ return OutputMessagePtr(new OutputMessage); }); - g_lua.bindClassMemberFunction("reset", &OutputMessage::reset); - g_lua.bindClassMemberFunction("addU8", &OutputMessage::addU8); - g_lua.bindClassMemberFunction("addU16", &OutputMessage::addU16); - g_lua.bindClassMemberFunction("addU32", &OutputMessage::addU32); - g_lua.bindClassMemberFunction("addU64", &OutputMessage::addU64); - g_lua.bindClassMemberFunction("addString", (void(OutputMessage::*)(const std::string&))&OutputMessage::addString); - - g_lua.registerClass(); - g_lua.bindClassStaticFunction("send", [](const ProtocolPtr proto, OutputMessagePtr msg) { proto->send(*msg.get()); }); - g_lua.registerClass(); g_lua.bindClassMemberFunction("setId", &Thing::setId); g_lua.bindClassMemberFunction("setPos", &Thing::setPos);