这篇教程C++ GetScriptId函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetScriptId函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScriptId函数的具体用法?C++ GetScriptId怎么用?C++ GetScriptId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetScriptId函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Assert void StepController::Activate(StepType stepType, InterpreterHaltState* haltState) { this->stepType = stepType; this->byteOffset = haltState->GetCurrentOffset(); this->pActivatedContext = haltState->framePointers->Peek()->GetScriptContext(); Assert(this->pActivatedContext); Js::FunctionBody* functionBody = haltState->GetFunction(); this->body.Root(functionBody, this->pActivatedContext->GetRecycler()); this->statementMap = body->GetMatchingStatementMapFromByteCode(byteOffset, false); this->frameCountWhenSet = haltState->framePointers->Count(); if (stepType != STEP_DOCUMENT) { this->frameAddrWhenSet = (size_t)haltState->framePointers->Peek(0)->GetStackAddress(); } else { // for doc mode, do not bail out automatically on frame changes this->frameAddrWhenSet = (size_t)-1; } this->scriptIdWhenSet = GetScriptId(functionBody); if (this->returnedValueList == nullptr) { this->returnedValueList = JsUtil::List<ReturnedValue*>::New(this->pActivatedContext->GetRecycler()); this->pActivatedContext->GetThreadContext()->SetReturnedValueList(this->returnedValueList); } }
开发者ID:mrkmarron,项目名称:ChakraCore,代码行数:31,
示例2: OnGoClickCW_DLL_EXPORTbool OnGoClick (Player *pPlayer, GameObject *pGameObject){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnGoClick) return true; return tmpscript->pOnGoClick(pPlayer,pGameObject);}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例3: OnCreatureKillCW_DLL_EXPORTvoid OnCreatureKill (Player *pPlayer, Creature *pCreature){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnCreatureKill) return; tmpscript->pOnCreatureKill(pPlayer,pCreature);}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例4: OnAreaChangeCW_DLL_EXPORTvoid OnAreaChange(Player *pPlayer, AreaTableEntry const *pArea){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnAreaChange) return; tmpscript->pOnAreaChange(pPlayer, pArea);}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例5: OnItemOpenCw_DLL_EXPORTbool OnItemOpen (Player *pPlayer, Item *pItem){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnItemOpen) return true; return tmpscript->pOnItemOpen(pPlayer,pItem);}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例6: OnServerShutdownCW_DLL_EXPORTvoid OnServerShutdown(){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnServerShutdown) return; tmpscript->pOnServerShutdown();}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例7: OnPlayerChatCW_DLL_EXPORTbool OnPlayerChat(Player *pPlayer, const char *text){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnPlayerChat) return true; return tmpscript->pOnPlayerChat(pPlayer,text);}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例8: OnGetMoneyCW_DLL_EXPORTuint32 OnGetMoney(Player *pPlayer, int32 amount){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnGetMoney) return amount; return tmpscript->pOnGetMoney(pPlayer,amount);}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,
示例9: GetScriptIdvoid Script::RegisterSelf(){ int id = GetScriptId(Name.c_str()); if(id) { m_scripts[id] = this; ++num_sc_scripts; }}
开发者ID:lus5d,项目名称:cwcore,代码行数:9,
示例10: GetScriptIdvoid Script::RegisterSelf(){ // try to find scripts which try to use another script's allocated memory // that means didn't allocate memory for script for (uint16 i = 0; i < MAX_SCRIPTS; ++i) { // somebody forgot to allocate memory for a script by a method like this: newscript = new Script if (m_scripts[i] == this) { sLog->outError("ScriptName: '%s' - Forgot to allocate memory, so this script and/or the script before that can't work.", Name.c_str()); // don't register it // and don't delete it because its memory is used for another script return; } } int id = GetScriptId(Name.c_str()); if (id) { // try to find the script in assigned scripts bool IsExist = false; for (uint16 i = 0; i < MAX_SCRIPTS; ++i) { if (m_scripts[i]) { // if the assigned script's name and the new script's name is the same if (m_scripts[i]->Name == Name) { IsExist = true; break; } } } // if the script doesn't assigned -> assign it! if (!IsExist) { m_scripts[id] = this; ++num_sc_scripts; } // if the script is already assigned -> delete it! else { // TODO: write a better error message than this one :) sLog->outError("ScriptName: '%s' already assigned with the same ScriptName, so the script can't work.", Name.c_str()); delete this; } } else { if (Name.find("example") == std::string::npos) sLog->outErrorDb("TSCR: RegisterSelf, but script named %s does not have ScriptName assigned in database.", (this)->Name.c_str()); delete this; }}
开发者ID:Bootz,项目名称:SF1,代码行数:55,
示例11: GetScriptIdvoid Script::RegisterSelf(){ int id = GetScriptId(Name.c_str()); if (id != 0) { m_scripts[id] = this; ++num_sc_scripts; } else { debug_log("SD2: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str()); delete this; }}
开发者ID:Apple15,项目名称:AppleCore,代码行数:14,
示例12: RegisterSelfvoid Script::RegisterSelf(bool bReportError){ if (uint32 id = GetScriptId(Name)) { m_scripts->at(id) = this; ++num_sc_scripts; } else { if (bReportError) script_error_log("Script registering but ScriptName %s is not assigned in database. Script will not be used.", Name); m_scriptStorage->insert(std::make_pair(Name, this)); }}
开发者ID:chaosskynet,项目名称:I_ScriptDev2,代码行数:15,
示例13: RegisterSelfvoid Script::RegisterSelf(bool bReportError){ if (uint32 id = GetScriptId(Name.c_str())) { m_scripts[id] = this; ++num_sc_scripts; } else { if (bReportError) script_error_log("Script registering but ScriptName %s is not assigned in database. Script will not be used.", Name.c_str()); delete this; }}
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:15,
示例14: RegisterSelfvoid Script::RegisterSelf(bool bReportError){ if (uint32 id = GetScriptId(Name.c_str())) { m_scripts[id] = this; ++num_sc_scripts; } else { if (bReportError) error_log("SD2: Script registering but ScriptName %s is not assigned in database. Script will not be used.", Name.c_str()); m_scriptStorage.insert(std::make_pair(Name.c_str(), this)); }}
开发者ID:finomen,项目名称:scriptdev2,代码行数:15,
示例15: GetScriptIdvoid Script::RegisterSelf(bool bReportError){ int id = GetScriptId(Name.c_str()); if (id != 0) { m_scripts[id] = this; ++num_sc_scripts; } else { if (bReportError) error_log("SD2: Script registering but ScriptName %s is not assigned in database. Script will not be used.", (this)->Name.c_str()); delete this; }}
开发者ID:leecher228,项目名称:scriptdev2,代码行数:16,
示例16: GetScriptIdvoid Script::RegisterSelf(bool bReportError){ int id = GetScriptId(Name.c_str()); if (id != 0) { m_scripts[id] = this; ++num_sc_scripts; } else { if (bReportError) error_db_log("脚本库: Script registering but ScriptName %s is not assigned in database.", (this)->Name.c_str()); m_scriptStorage.insert(std::make_pair(Name.c_str(), this)); }}
开发者ID:cbcs,项目名称:ChgSD2,代码行数:16,
示例17: barvoid ScriptMgr::LoadAreaTriggerScripts(){ m_AreaTriggerScripts.clear(); // need for reload case QueryResult *result = WorldDatabase.Query("SELECT entry, ScriptName FROM scripted_areatrigger"); uint32 count = 0; if (!result) { barGoLink bar(1); bar.step(); sLog.outString(); sLog.outString(">> Loaded %u scripted areatrigger", count); return; } barGoLink bar((int)result->GetRowCount()); do { ++count; bar.step(); Field *fields = result->Fetch(); uint32 triggerId = fields[0].GetUInt32(); const char *scriptName = fields[1].GetString(); if (!sAreaTriggerStore.LookupEntry(triggerId)) { sLog.outErrorDb("Table `scripted_areatrigger` has area trigger (ID: %u) not listed in `AreaTrigger.dbc`.", triggerId); continue; } m_AreaTriggerScripts[triggerId] = GetScriptId(scriptName); } while(result->NextRow()); delete result; sLog.outString(); sLog.outString(">> Loaded %u areatrigger scripts", count);}
开发者ID:lastsmile,项目名称:mangos,代码行数:43,
示例18: OnLogoutvoid ScriptMgr::OnLogout(Player* player){ Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->pOnLogout) return; tmpscript->pOnLogout(player);}
开发者ID:Bootz,项目名称:SF1,代码行数:6,
示例19: OnGroupDisbandedvoid ScriptMgr::OnGroupDisbanded(Group* pGroup, Player* pLeader){ Script* tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->OnGroupDisbanded) return; tmpscript->OnGroupDisbanded(pGroup, pLeader);}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:6,
示例20: OnGroupLeaderChangedvoid ScriptMgr::OnGroupLeaderChanged(Group* pGroup, Player* pOldLeader, Player* pNewLeader){ Script* tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->OnGroupLeaderChanged) return; tmpscript->OnGroupLeaderChanged(pGroup, pOldLeader, pNewLeader);}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:6,
示例21: OnGroupPlayerRemovedvoid ScriptMgr::OnGroupPlayerRemoved(Group* pGroup, Player* pPlayer, uint8 method, uint64 kicker, const char* reason){ Script* tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->OnGroupPlayerRemoved) return; tmpscript->OnGroupPlayerRemoved(pGroup, pPlayer, method, kicker, reason);}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:6,
示例22: OnPlayerTalentsResetvoid ScriptMgr::OnPlayerTalentsReset(Player* player, bool no_cost){ Script* tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->OnTalentsReset) return; tmpscript->OnTalentsReset(player, no_cost);}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:6,
示例23: OnPlayerLevelChangedvoid ScriptMgr::OnPlayerLevelChanged(Player* player, uint8 newLevel){ Script* tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->OnLevelChanged) return; tmpscript->OnLevelChanged(player, newLevel);}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:6,
示例24: OnPlayerKilledByCreaturevoid ScriptMgr::OnPlayerKilledByCreature(Creature* killer, Player* killed){ Script* tmpscript = m_scripts[GetScriptId("scripted_on_events")]; if (!tmpscript || !tmpscript->OnPlayerKilledByCreature) return; tmpscript->OnPlayerKilledByCreature(killer, killed);}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:6,
注:本文中的GetScriptId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetScrollInfo函数代码示例 C++ GetScriptContext函数代码示例 |