コード例 #1
0
ファイル: ScriptMgr.cpp プロジェクト: ErYayo/StrawberryCore
void ScriptMgr::InitScriptLibrary()
{
    LoadDatabase();

    outstring_log("StrawberryScripts: Loading C++ scripts");
    BarGoLink bar(1);
    bar.step();
    outstring_log("");

    // Resize script ids to needed ammount of assigned ScriptNames (from core)
    m_scripts.resize(GetScriptIdsCount(), NULL);

    FillSpellSummary();

    AddScripts();

    // Check existance scripts for all registered by core script names
    for (uint32 i = 1; i < GetScriptIdsCount(); ++i)
    {
        if (!m_scripts[i])
            error_log("SSC: No script found for ScriptName '%s'.", GetScriptName(i));
    }

    outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
}
コード例 #2
0
ファイル: ScriptMgr.cpp プロジェクト: AwkwardDev/mangos-d3
MANGOS_DLL_EXPORT
void InitScriptLibrary()
{
    // ScriptDev2 startup
    outstring_log("");
    outstring_log(" MMM  MMM    MM");
    outstring_log("M  MM M  M  M  M");
    outstring_log("MM    M   M   M");
    outstring_log(" MMM  M   M  M");
    outstring_log("   MM M   M MMMM");
    outstring_log("MM  M M  M ");
    outstring_log(" MMM  MMM  http://www.scriptdev2.com");
    outstring_log("");

   // Get configuration file
   bool configFailure = false;
   if (!SD2Config.SetSource(_MANGOSD_CONFIG))
       configFailure = true;
   else
       outstring_log("SD2: Using configuration file %s", _MANGOSD_CONFIG);

   // Set SD2 Error Log File
   std::string sd2LogFile = SD2Config.GetStringDefault("SD2ErrorLogFile", "SD2Errors.log");
   setScriptLibraryErrorFile(sd2LogFile.c_str(), "SD2");

   if (configFailure)
       script_error_log("Unable to open configuration file. Database will be unaccessible. Configuration values will use default.");

   // Check config file version
   if (SD2Config.GetIntDefault("ConfVersion", 0) != _MANGOSDCONFVERSION)
       script_error_log("Configuration file version doesn't match expected version. Some config variables may be wrong or missing.");

   outstring_log("");

   // Load database (must be called after SD2Config.SetSource).
    LoadDatabase();

    outstring_log("SD2: Loading C++ scripts");
    BarGoLink bar(1);
    bar.step();
    outstring_log("");

    // Resize script ids to needed ammount of assigned ScriptNames (from core)
    m_scripts.resize(GetScriptIdsCount(), NULL);

    FillSpellSummary();

    AddScripts();

    // Check existance scripts for all registered by core script names
    for (uint32 i = 1; i < GetScriptIdsCount(); ++i)
    {
        if (!m_scripts[i])
            script_error_log("No script found for ScriptName '%s'.", GetScriptName(i));
    }

    outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
}
コード例 #3
0
ファイル: ScriptMgr.cpp プロジェクト: finomen/scriptdev2
MANGOS_DLL_EXPORT
void InitScriptLibrary()
{
    // ScriptDev2 startup
    outstring_log("");
    outstring_log(" MMM  MMM    MM");
    outstring_log("M  MM M  M  M  M");
    outstring_log("MM    M   M   M");
    outstring_log(" MMM  M   M  M");
    outstring_log("   MM M   M MMMM");
    outstring_log("MM  M M  M ");
    outstring_log(" MMM  MMM  http://www.scriptdev2.com");
    outstring_log("R2 modifications included (https://github.com/mangosR2/scriptdev2)");
    outstring_log(_VERSION);

    // Get configuration file
    if (!SD2Config.SetSource(_SCRIPTDEV2_CONFIG))
        error_log("SD2: Unable to open configuration file. Database will be unaccessible. Configuration values will use default.");
    else
        outstring_log("SD2: Using configuration file %s",_SCRIPTDEV2_CONFIG);

    // Check config file version
    if (SD2Config.GetIntDefault("ConfVersion", 0) != SD2_CONF_VERSION)
        error_log("SD2: Configuration file version doesn't match expected version. Some config variables may be wrong or missing.");

    outstring_log("");

    // Load database (must be called after SD2Config.SetSource).
    LoadDatabase();

    outstring_log("SD2: Loading C++ scripts");
    BarGoLink bar(1);
    bar.step();
    outstring_log("");

    // Resize script ids to needed ammount of assigned ScriptNames (from core)
    m_scripts.resize(GetScriptIdsCount(), NULL);

    m_scriptStorage.clear();

    FillSpellSummary();

    AddScripts();

    // Check existance scripts for all registered by core script names
    for (uint32 i = 1; i < GetScriptIdsCount(); ++i)
    {
        if (!m_scripts[i])
            error_log("SD2: No script found for ScriptName '%s'.", GetScriptName(i));
    }

    outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
}
コード例 #4
0
ファイル: ScriptDevMgr.cpp プロジェクト: Corsol/ScriptDev3
void SD3::InitScriptLibrary()
{
    // ScriptDev3 startup
    outstring_log("   ___         _      _   ___            ____");
    outstring_log("  / __| __ _ _(_)_ __| |_|   \\ _____ __ |__ /");
    outstring_log("  \\__ \\/ _| '_| | '_ \\  _| |) / -_) V /  |_ \\");
    outstring_log("  |___/\\__|_| |_| .__/\\__|___/\\___|\\_/  |___/");
    outstring_log("                |_|                          ");
    outstring_log("                     https://getmangos.eu/\n");

    // Get configuration file
    bool configFailure = false;
    if (!SD3Config.SetSource(MANGOSD_CONFIG_LOCATION))
    {
        configFailure = true;
    }
    else
    {
        outstring_log("sd3: Using configuration file %s", MANGOSD_CONFIG_LOCATION);
    }

    // Set SD3 Error Log File
    std::string SD3LogFile = SD3Config.GetStringDefault("SD3ErrorLogFile", "scriptdev3-errors.log");
    setScriptLibraryErrorFile(SD3LogFile.c_str(), "SD3");

    if (configFailure)
    {
        script_error_log("Unable to open configuration file. Database will be unaccessible. Configuration values will use default.");
    }

    // Check config file version
    if (SD3Config.GetIntDefault("ConfVersion", 0) != MANGOSD_CONFIG_VERSION)
    {
        script_error_log("Configuration file version doesn't match expected version. Some config variables may be wrong or missing.");
    }

    outstring_log("\n");

    // Load database (must be called after SD3Config.SetSource).
    LoadDatabase();

    outstring_log("sd3: Loading C++ scripts");
    BarGoLink bar(1);
    bar.step();

    // Resize script ids to needed ammount of assigned ScriptNames (from core)
    m_scripts.resize(GetScriptIdsCount(), NULL);

    FillSpellSummary();

    AddScripts();

    // Check existance scripts for all registered by core script names
    for (uint32 i = 1; i < GetScriptIdsCount(); ++i)
    {
        if (!m_scripts[i])
        {
            script_error_log("No script found for ScriptName '%s'.", GetScriptName(i));
        }
    }

    outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
}