示例#1
0
void Eluna::_ReloadEluna()
{
    LOCK_ELUNA;
    ASSERT(IsInitialized());

    eWorld->SendServerMessage(SERVER_MSG_STRING, "Reloading Eluna...");

    // Remove all timed events
    sEluna->eventMgr->SetStates(LUAEVENT_STATE_ERASE);

    // Close lua
    sEluna->CloseLua();

    // Reload script paths
    LoadScriptPaths();

    // Open new lua and libaraies
    sEluna->OpenLua();

    // Run scripts from laoded paths
    sEluna->RunScripts();

#ifdef TRINITY
    // Re initialize creature AI restoring C++ AI or applying lua AI
    {
        HashMapHolder<Creature>::MapType const m = ObjectAccessor::GetCreatures();
        for (HashMapHolder<Creature>::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter)
            if (iter->second->IsInWorld())
                iter->second->AIM_Initialize();
    }
#endif

    reload = false;
}
示例#2
0
void Eluna::_ReloadEluna()
{
    LOCK_ELUNA;
    ASSERT(IsInitialized());

    eWorld->SendServerMessage(SERVER_MSG_STRING, "Reloading Eluna...");

    // Remove all timed events
    sEluna->eventMgr->SetStates(LUAEVENT_STATE_ERASE);

    // Close lua
    sEluna->CloseLua();

    // Reload script paths
    LoadScriptPaths();

    // Open new lua and libaraies
    sEluna->OpenLua();

    // Run scripts from laoded paths
    sEluna->RunScripts();

#ifdef TRINITY
    // Re initialize creature AI restoring C++ AI or applying lua AI
    sMapMgr->DoForAllMaps([](Map* map)
    {
        ElunaAIUpdateWorker worker;
        TypeContainerVisitor<ElunaAIUpdateWorker, MapStoredObjectTypesContainer> visitor(worker);
        visitor.Visit(map->GetObjectsStore());
    });
#endif

    reload = false;
}
示例#3
0
void Eluna::Initialize()
{
    LOCK_ELUNA;
    ASSERT(!IsInitialized());

    LoadScriptPaths();

    // Must be before creating GEluna
    // This is checked on Eluna creation
    initialized = true;

    // Create global eluna
    GEluna = new Eluna();
}
示例#4
0
void Eluna::Initialize()
{
    LOCK_ELUNA;
    ASSERT(!IsInitialized());

#ifdef TRINITY
    // For instance data the data column needs to be able to hold more than 255 characters (tinytext)
    // so we change it to TEXT automatically on startup
    CharacterDatabase.DirectExecute("ALTER TABLE `instance` CHANGE COLUMN `data` `data` TEXT NOT NULL");
#endif

    LoadScriptPaths();

    // Must be before creating GEluna
    // This is checked on Eluna creation
    initialized = true;

    // Create global eluna
    GEluna = new Eluna();
}