Eluna fix crash in timed events and prepare some for future changes. Ditched EventProcessor

This commit is contained in:
Rochet2
2014-09-13 16:05:16 +03:00
parent 7be917335a
commit 06be9650bb
12 changed files with 388 additions and 346 deletions

View File

@@ -12,9 +12,7 @@
#include "ElunaTemplate.h"
#include "ElunaUtility.h"
// Some dummy includes containing BOOST_VERSION:
// ObjectAccessor.h Config.h Log.h
#ifdef BOOST_VERSION
#ifdef USING_BOOST
#include <boost/filesystem.hpp>
#else
#include <ace/ACE.h>
@@ -89,7 +87,7 @@ void Eluna::ReloadEluna()
Eluna::Eluna():
L(luaL_newstate()),
m_EventMgr(new EventMgr(*this)),
eventMgr(NULL),
ServerEventBindings(new EventBind<HookMgr::ServerEvents>("ServerEvents", *this)),
PlayerEventBindings(new EventBind<HookMgr::PlayerEvents>("PlayerEvents", *this)),
@@ -122,6 +120,10 @@ playerGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (player)
ASSERT(!Eluna::GEluna);
Eluna::GEluna = this;
// Set event manager. Must be after setting sEluna
eventMgr = new EventMgr();
eventMgr->globalProcessor = new ElunaEventProcessor(NULL);
// run scripts
RunScripts();
@@ -132,7 +134,7 @@ Eluna::~Eluna()
{
OnLuaStateClose();
delete m_EventMgr;
delete eventMgr;
// Replace this with map remove if making multithread version
Eluna::GEluna = NULL;
@@ -190,7 +192,7 @@ void Eluna::GetScripts(std::string path, ScriptList& scripts)
{
ELUNA_LOG_DEBUG("[Eluna]: GetScripts from path `%s`", path.c_str());
#ifdef BOOST_VERSION
#ifdef USING_BOOST
boost::filesystem::path someDir(path);
boost::filesystem::directory_iterator end_iter;