本文整理汇总了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();
}