• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetScriptId函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetScriptId函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScriptId函数的具体用法?C++ GetScriptId怎么用?C++ GetScriptId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetScriptId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:DiagProbe.cpp


示例2: OnGoClick

CW_DLL_EXPORT
bool 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,代码来源:ScriptMgr.cpp


示例3: OnCreatureKill

CW_DLL_EXPORT
void 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,代码来源:ScriptMgr.cpp


示例4: OnAreaChange

CW_DLL_EXPORT
void 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,代码来源:ScriptMgr.cpp


示例5: OnItemOpen

Cw_DLL_EXPORT
bool 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,代码来源:ScriptMgr.cpp


示例6: OnServerShutdown

CW_DLL_EXPORT
void OnServerShutdown()
{
    Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")];
    if (!tmpscript || !tmpscript->pOnServerShutdown) return;
    tmpscript->pOnServerShutdown();
}
开发者ID:lus5d,项目名称:cwcore,代码行数:7,代码来源:ScriptMgr.cpp


示例7: OnPlayerChat

CW_DLL_EXPORT
bool 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,代码来源:ScriptMgr.cpp


示例8: OnGetMoney

CW_DLL_EXPORT
uint32 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,代码来源:ScriptMgr.cpp


示例9: GetScriptId

void Script::RegisterSelf()
{
    int id = GetScriptId(Name.c_str());
    if(id)
    {
        m_scripts[id] = this;
        ++num_sc_scripts;
    }
}
开发者ID:lus5d,项目名称:cwcore,代码行数:9,代码来源:ScriptMgr.cpp


示例10: GetScriptId

void 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,代码来源:ScriptMgr.cpp


示例11: GetScriptId

void 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,代码来源:ScriptMgr.cpp


示例12: RegisterSelf

void 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,代码来源:ScriptMgr.cpp


示例13: RegisterSelf

void 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,代码来源:ScriptMgr.cpp


示例14: RegisterSelf

void 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,代码来源:ScriptMgr.cpp


示例15: GetScriptId

void 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,代码来源:ScriptMgr.cpp


示例16: GetScriptId

void 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,代码来源:ScriptMgr.cpp


示例17: bar

void 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,代码来源:ScriptMgr.cpp


示例18: OnLogout

void ScriptMgr::OnLogout(Player* player)
{
    Script *tmpscript = m_scripts[GetScriptId("scripted_on_events")];
    if (!tmpscript || !tmpscript->pOnLogout) return;
    tmpscript->pOnLogout(player);
}
开发者ID:Bootz,项目名称:SF1,代码行数:6,代码来源:ScriptMgr.cpp


示例19: OnGroupDisbanded

void 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,代码来源:ScriptMgr.cpp


示例20: OnGroupLeaderChanged

void 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,代码来源:ScriptMgr.cpp



注:本文中的GetScriptId函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetScrollInfo函数代码示例发布时间:2022-05-30
下一篇:
C++ GetScriptContext函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap