本文整理汇总了C++中SDScriptVec类的典型用法代码示例。如果您正苦于以下问题:C++ SDScriptVec类的具体用法?C++ SDScriptVec怎么用?C++ SDScriptVec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SDScriptVec类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FreeScriptLibrary
void FreeScriptLibrary()
{
// Free Spell Summary
delete []SpellSummary;
// Free resources before library unload
for (SDScriptVec::const_iterator itr = m_scripts.begin(); itr != m_scripts.end(); ++itr)
delete *itr;
m_scripts.clear();
num_sc_scripts = 0;
}
示例2: FreeScriptLibrary
MANGOS_DLL_EXPORT
void FreeScriptLibrary()
{
// Free Spell Summary
delete []SpellSummary;
// Free resources before library unload
for (SDScriptVec::const_iterator itr = m_scripts.begin(); itr != m_scripts.end(); ++itr)
delete *itr;
m_scripts.clear();
num_sc_scripts = 0;
setScriptLibraryErrorFile(NULL, NULL);
}
示例3: FreeScriptLibrary
MANGOS_DLL_EXPORT
void FreeScriptLibrary()
{
// Free Spell Summary
delete []SpellSummary;
// Free resources before library unload
for (SDScriptVec::const_iterator itr = m_scripts.begin(); itr != m_scripts.end(); ++itr)
delete *itr;
m_scripts.clear();
for (std::map<std::string, Script*>::iterator itr = m_scriptStorage.begin(); itr != m_scriptStorage.end(); ++itr)
delete itr->second;
num_sc_scripts = 0;
SD2Database.HaltDelayThread();
}
示例4: InitScriptLibrary
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);
}
示例5: InitScriptLibrary
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);
}
示例6: InitScriptLibrary
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);
}
示例7: bar
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);
}