Improved pushing so that a single userdata is used per object pushed.
Made everything use the singleton less, allowing more free code and easier to implement multithreading later.
Made macros for hookmgr and fixed the issue with hooks called inside hooks.
This commit is contained in:
Rochet2
2014-06-01 23:58:28 +03:00
committed by Foereaper
parent e131f36d39
commit b1f85bfc21
25 changed files with 3169 additions and 3666 deletions

View File

@@ -5,7 +5,9 @@
*/
// Eluna
#include "HookMgr.h"
#include "LuaEngine.h"
#include "Includes.h"
// Methods
#include "GlobalMethods.h"
#include "ObjectMethods.h"
@@ -30,7 +32,7 @@
void RegisterGlobals(lua_State* L)
{
// Hooks
lua_register(L, "RegisterPacketEvent", &LuaGlobalFunctions::RegisterPacketEvent); // RegisterPacketEvent(opcodeID, function)
lua_register(L, "RegisterPacketEvent", &LuaGlobalFunctions::RegisterPacketEvent); // RegisterPacketEvent(opcodeID, event, function)
lua_register(L, "RegisterServerEvent", &LuaGlobalFunctions::RegisterServerEvent); // RegisterServerEvent(event, function)
lua_register(L, "RegisterPlayerEvent", &LuaGlobalFunctions::RegisterPlayerEvent); // RegisterPlayerEvent(event, function)
lua_register(L, "RegisterGuildEvent", &LuaGlobalFunctions::RegisterGuildEvent); // RegisterGuildEvent(event, function)
@@ -75,7 +77,7 @@ void RegisterGlobals(lua_State* L)
lua_register(L, "GetMapById", &LuaGlobalFunctions::GetMapById); // GetMapById(mapId, instance) - Returns map object of id specified. UNDOCUMENTED
// Other
// lua_register(L, "ReloadEluna", &LuaGlobalFunctions::ReloadEluna); // ReloadEluna() - Reload's Eluna engine. Returns true if reload succesful.
lua_register(L, "ReloadEluna", &LuaGlobalFunctions::ReloadEluna); // ReloadEluna() - Reload's Eluna engine.
lua_register(L, "SendWorldMessage", &LuaGlobalFunctions::SendWorldMessage); // SendWorldMessage(msg) - Sends a broadcast message to everyone
lua_register(L, "WorldDBQuery", &LuaGlobalFunctions::WorldDBQuery); // WorldDBQuery(sql) - Executes given SQL query to world database instantly and returns a QueryResult object
lua_register(L, "WorldDBExecute", &LuaGlobalFunctions::WorldDBExecute); // WorldDBExecute(sql) - Executes given SQL query to world database (not instant)
@@ -1193,7 +1195,7 @@ void RegisterFunctions(lua_State* L)
{
RegisterGlobals(L);
// You should add sHookMgr->RemoveRef(this); to all destructors for objects that are NOT mem managed (gc) by lua.
// You should add Eluna::RemoveRef(this); to all destructors for objects that are NOT mem managed (gc) by lua.
// Exceptions being Quest type static data structs that will never be destructed (during runtime), though they can have it as well.
ElunaTemplate<Object>::Register(L, "Object");