当前位置: 首页>>代码示例>>C++>>正文


C++ LLMessageSystem::addS8Fast方法代码示例

本文整理汇总了C++中LLMessageSystem::addS8Fast方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMessageSystem::addS8Fast方法的具体用法?C++ LLMessageSystem::addS8Fast怎么用?C++ LLMessageSystem::addS8Fast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLMessageSystem的用法示例。


在下文中一共展示了LLMessageSystem::addS8Fast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: link_inventory_item

void link_inventory_item(
    const LLUUID& agent_id,
    const LLUUID& item_id,
    const LLUUID& parent_id,
    const std::string& new_name,
    const std::string& new_description,
    const LLAssetType::EType asset_type,
    LLPointer<LLInventoryCallback> cb)
{
    const LLInventoryObject *baseobj = gInventory.getObject(item_id);
    if (!baseobj)
    {
        llwarns << "attempt to link to unknown item, linked-to-item's itemID " << item_id << llendl;
        return;
    }
    if (baseobj && baseobj->getIsLinkType())
    {
        llwarns << "attempt to create a link to a link, linked-to-item's itemID " << item_id << llendl;
        return;
    }

    if (baseobj && !LLAssetType::lookupCanLink(baseobj->getType()))
    {
        // Fail if item can be found but is of a type that can't be linked.
        // Arguably should fail if the item can't be found too, but that could
        // be a larger behavioral change.
        llwarns << "attempt to link an unlinkable item, type = " << baseobj->getActualType() << llendl;
        return;
    }

    LLUUID transaction_id;
    LLInventoryType::EType inv_type = LLInventoryType::IT_NONE;
    if (dynamic_cast<const LLInventoryCategory *>(baseobj))
    {
        inv_type = LLInventoryType::IT_CATEGORY;
    }
    else
    {
        const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj);
        if (baseitem)
        {
            inv_type = baseitem->getInventoryType();
        }
    }

    LLMessageSystem* msg = gMessageSystem;
    msg->newMessageFast(_PREHASH_LinkInventoryItem);
    msg->nextBlock(_PREHASH_AgentData);
    {
        msg->addUUIDFast(_PREHASH_AgentID, agent_id);
        msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
    }
    msg->nextBlock(_PREHASH_InventoryBlock);
    {
        msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb));
        msg->addUUIDFast(_PREHASH_FolderID, parent_id);
        msg->addUUIDFast(_PREHASH_TransactionID, transaction_id);
        msg->addUUIDFast(_PREHASH_OldItemID, item_id);
        msg->addS8Fast(_PREHASH_Type, (S8)asset_type);
        msg->addS8Fast(_PREHASH_InvType, (S8)inv_type);
        msg->addStringFast(_PREHASH_Name, new_name);
        msg->addStringFast(_PREHASH_Description, new_description);
    }
    gAgent.sendReliableMessage();
}
开发者ID:fractured-crystal,项目名称:SssnowGlobeeE,代码行数:65,代码来源:llviewerinventory.cpp


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