本文整理汇总了C++中LLAgent::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAgent::getID方法的具体用法?C++ LLAgent::getID怎么用?C++ LLAgent::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAgent
的用法示例。
在下文中一共展示了LLAgent::getID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send_namedesc
void ImportTracker::send_namedesc(LLSD& prim)
{
if(prim.has("name"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectName);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_Name, prim["name"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
if(prim.has("description"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDescription);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_Description, prim["description"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
}
示例2: send_namedesc
void ImportTracker::send_namedesc(LLSD& prim)
{
if(prim.has("name"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectName);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_Name, prim["name"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
if(prim.has("description"))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDescription);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
LLVector3 scale = prim["scale"];
if((scale.mV[VX] > 10.) || (scale.mV[VY] > 10.) || (scale.mV[VZ] > 10.) )
prim["description"] = llformat("<%d, %d, %d>", (U8)scale.mV[VX], (U8)scale.mV[VY], (U8)scale.mV[VZ]);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_Description, prim["description"]);
msg->sendReliable(gAgent.getRegion()->getHost());
}
}
示例3: getItem
LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid) :
LLPreview( name, rect, title, item_uuid, object_uuid)
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml");
childSetAction("Sound play btn",&LLPreviewSound::playSound,this);
childSetAction("Sound audition btn",&LLPreviewSound::auditionSound,this);
// <edit>
childSetAction("Sound copy uuid btn", &LLPreviewSound::copyUUID, this);
childSetAction("Play ambient btn", &LLPreviewSound::playAmbient, this);
// </edit>
LLButton* button = getChild<LLButton>("Sound play btn");
button->setSoundFlags(LLView::SILENT);
button = getChild<LLButton>("Sound audition btn");
button->setSoundFlags(LLView::SILENT);
const LLInventoryItem* item = getItem();
mIsCopyable = false;
if(item)
{
const LLPermissions& perm = item->getPermissions();
mIsCopyable = (perm.getCreator() == gAgent.getID());
}
childSetCommitCallback("desc", LLPreview::onText, this);
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
// preload the sound
if(item && gAudiop)
{
gAudiop->preloadSound(item->getAssetUUID());
// <edit>
// that thing above doesn't actually start a sound transfer, so I will do it
//LLAudioSource *asp = new LLAudioSource(gAgent.getID(), gAgent.getID(), F32(1.0f), LLAudioEngine::AUDIO_TYPE_UI);
LLAudioSource *asp = gAgentAvatarp->getAudioSource(gAgent.getID());
LLAudioData *datap = gAudiop->getAudioData(item->getAssetUUID());
asp->addAudioData(datap, FALSE);
// </edit>
}
setTitle(title);
if (!getHost())
{
LLRect curRect = getRect();
translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
}
}
示例4: wear
void ImportTracker::wear(LLSD &prim)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAttach);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addU8Fast(_PREHASH_AttachmentPoint, U8(prim["Attachment"].asInteger()));
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addQuatFast(_PREHASH_Rotation, LLQuaternion(0.0f, 0.0f, 0.0f, 1.0f));
msg->sendReliable(gAgent.getRegion()->getHost());
LLVector3 position = prim["attachpos"];
LLSD rot = prim["attachrot"];
LLQuaternion rotq;
rotq.mQ[VX] = (F32)(rot[0].asReal());
rotq.mQ[VY] = (F32)(rot[1].asReal());
rotq.mQ[VZ] = (F32)(rot[2].asReal());
rotq.mQ[VW] = (F32)(rot[3].asReal());
LLVector3 rotation = rotq.packToVector3();
U8 data[256];
LLMessageSystem* msg2 = gMessageSystem;
msg2->newMessageFast(_PREHASH_MultipleObjectUpdate);
msg2->nextBlockFast(_PREHASH_AgentData);
msg2->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg2->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg2->nextBlockFast(_PREHASH_ObjectData);
msg2->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg2->addU8Fast(_PREHASH_Type, U8(0x01 | 0x08));
htonmemcpy(&data[0], &(position.mV), MVT_LLVector3, 12);
msg2->addBinaryDataFast(_PREHASH_Data, data, 12);
msg2->nextBlockFast(_PREHASH_ObjectData);
msg2->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg2->addU8Fast(_PREHASH_Type, U8(0x02 | 0x08));
htonmemcpy(&data[0], &(rotation.mV), MVT_LLQuaternion, 12);
msg2->addBinaryDataFast(_PREHASH_Data, data, 12);
msg2->sendReliable(gAgent.getRegion()->getHost());
llinfos << "POSITIONED, IMPORT COMPLETED" << llendl;
cleanUp();
}
示例5: plywood_above_head
void ImportTracker::plywood_above_head()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED);
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52345f, 0.52346f, 0.52347f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
if (!localids.size())
root = (initialPos + linksetoffset);
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例6: plyWood
void Object::plyWood()
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectAdd);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU8Fast(_PREHASH_Material, 3);
//msg->addU32Fast(_PREHASH_AddFlags, ); // CREATE_SELECTED
LLVolumeParams volume_params;
volume_params.setType(0x01, 0x10);
volume_params.setBeginAndEndS(0.f, 1.f);
volume_params.setBeginAndEndT(0.f, 1.f);
volume_params.setRatio(1, 1);
volume_params.setShear(0, 0);
LLVolumeMessage::packVolumeParams(&volume_params, msg);
msg->addU8Fast(_PREHASH_PCode, 9);
msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.52346f, 0.52347f, 0.52348f));
LLQuaternion rot;
msg->addQuatFast(_PREHASH_Rotation, rot);
LLViewerRegion *region = gAgent.getRegion();
LLVector3 root(0.f,0.f,0.1f);
root+=gAgent.getCameraPositionAgent();
msg->addVector3Fast(_PREHASH_RayStart, root);
msg->addVector3Fast(_PREHASH_RayEnd, root);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE );
msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE );
msg->addU8Fast(_PREHASH_State, (U8)0);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->sendReliable(region->getHost());
}
示例7: send_image
void ImportTracker::send_image(LLSD& prim)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectImage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addStringFast(_PREHASH_MediaURL, NULL);
LLPrimitive obj;
LLSD tes = prim["textures"];
obj.setNumTEs(U8(tes.size()));
for (int i = 0; i < tes.size(); i++)
{
LLTextureEntry tex;
tex.fromLLSD(tes[i]);
obj.setTE(U8(i), tex);
}
obj.packTEMessage(gMessageSystem);
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例8: auditionSound
// static
void LLPreviewSound::auditionSound( void *userdata )
{
LLPreviewSound* self = (LLPreviewSound*) userdata;
const LLInventoryItem *item = self->getItem();
if(item && gAudiop)
{
LLVector3d lpos_global = gAgent.getPositionGlobal();
gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, lpos_global);
}
}
示例9: JCImportTransferCallback
/*virtual*/ void uploadComplete(const LLSD& content)
{
LLPointer<LLInventoryCallback> cb = new JCImportTransferCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}
示例10: send_shape
void ImportTracker::send_shape(LLSD& prim)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectShape);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
LLVolumeParams params;
params.fromLLSD(prim["volume"]);
LLVolumeMessage::packVolumeParams(¶ms, msg);
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例11: JCImportInventorycallback
void JCImportInventorycallback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
if(result == LL_ERR_NOERR)
{
//cmdline_printchat("fired importinvcall for "+uuid.asString());
InventoryImportInfo* data = (InventoryImportInfo*)user_data;
LLPointer<LLInventoryCallback> cb = new JCImportTransferCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}else cmdline_printchat("err: "+std::string(LLAssetStorage::getErrorString(result)));
}
示例12: send_vectors
void ImportTracker::send_vectors(LLSD& prim,int counter)
{
LLVector3 position = ((LLVector3)prim["position"] * rootrot) + root;
LLSD rot = prim["rotation"];
LLQuaternion rotq;
rotq.mQ[VX] = (F32)(rot[0].asReal());
rotq.mQ[VY] = (F32)(rot[1].asReal());
rotq.mQ[VZ] = (F32)(rot[2].asReal());
rotq.mQ[VW] = (F32)(rot[3].asReal());
LLVector3 rotation;
if(counter == 1)
rotation = rotq.packToVector3();
else
rotation = (rotq * rootrot).packToVector3();
LLVector3 scale = prim["scale"];
U8 data[256];
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MultipleObjectUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Type, U8(0x01));
htonmemcpy(&data[0], &(position.mV), MVT_LLVector3, 12);
msg->addBinaryDataFast(_PREHASH_Data, data, 12);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Type, U8(0x02));
htonmemcpy(&data[0], &(rotation.mV), MVT_LLQuaternion, 12);
msg->addBinaryDataFast(_PREHASH_Data, data, 12);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, prim["LocalID"].asInteger());
msg->addU8Fast(_PREHASH_Type, U8(0x04));
htonmemcpy(&data[0], &(scale.mV), MVT_LLVector3, 12);
msg->addBinaryDataFast(_PREHASH_Data, data, 12);
msg->sendReliable(gAgent.getRegion()->getHost());
}
示例13: postBuild
// virtual
BOOL LLPreviewAnim::postBuild()
{
const LLInventoryItem* item = getItem();
// preload the animation
if(item)
{
gAgentAvatarp->createMotion(item->getAssetUUID());
childSetText("desc", item->getDescription());
const LLPermissions& perm = item->getPermissions();
mIsCopyable = (perm.getCreator() == gAgent.getID());
}
childSetAction("Anim play btn",playAnim,this);
childSetAction("Anim audition btn",auditionAnim,this);
childSetCommitCallback("desc", LLPreview::onText, this);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
return LLPreview::postBuild();
}
示例14: insert
void insert(LLViewerInventoryItem* item, LLViewerObject* objectp, InventoryImportInfo* data)
{
if(!item)
{
return;
}
if(objectp)
{
LLToolDragAndDrop::dropScript(objectp,
item,
TRUE,
LLToolDragAndDrop::SOURCE_AGENT,
gAgent.getID());
//cmdline_printchat("inserted.");
}
delete data;
gImportTracker.asset_insertions -= 1;
if(gImportTracker.asset_insertions == 0)
{
gImportTracker.finish();
}
}
示例15: send_inventory
//.........这里部分代码省略.........
LLVFile file(gVFS, data->assetid, data->type, LLVFile::WRITE);
file.setMaxSize(file_size);
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while ((file_size = infile.read(copy_buf, buf_size)))
{
file.write(copy_buf, file_size);
}
LLSD body;
body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
body["asset_type"] = LLAssetType::lookup(data->type);
body["inventory_type"] = LLInventoryType::lookup(data->inv_type);
body["name"] = data->name;
body["description"] = data->description;
body["next_owner_mask"] = LLSD::Integer(U32_MAX);
body["group_mask"] = LLSD::Integer(U32_MAX);
body["everyone_mask"] = LLSD::Integer(U32_MAX);
body["expected_upload_cost"] = LLSD::Integer(LLGlobalEconomy::Singleton::getInstance()->getPriceUpload());
//cmdline_printchat("posting "+ data->assetid.asString());
LLHTTPClient::post(url, body, new JCImportInventoryResponder(body, data->assetid, data->type,data));
//error = TRUE;
}
}
break;
case LLAssetType::AT_CLOTHING:
case LLAssetType::AT_BODYPART:
//cmdline_printchat("case cloth/bodypart");
{
S32 file_size;
LLAPRFile infile ;
infile.open(data->filename, LL_APR_RB, NULL, &file_size);
if (infile.getFileHandle())
{
//cmdline_printchat("got file handle @ cloth");
LLVFile file(gVFS, data->assetid, data->type, LLVFile::WRITE);
file.setMaxSize(file_size);
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while ((file_size = infile.read(copy_buf, buf_size)))
{
file.write(copy_buf, file_size);
}
LLFILE* fp = LLFile::fopen(data->filename, "rb");
if(fp)//HACK LOL LOL LOL
{
LLWearable* wearable = new LLWearable(LLUUID::null);
wearable->importFile( fp );
//if (!res)
{
data->wear_type = wearable->getType();
}
delete wearable;
}
//cmdline_printchat("storing "+data->assetid.asString());
gAssetStorage->storeAssetData(data->tid, data->type,
JCImportInventorycallback,
(void*)data,
FALSE,
TRUE,
FALSE);
}
}
break;
case LLAssetType::AT_NOTECARD:
//cmdline_printchat("case notecard");
{
//std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
LLPointer<LLInventoryCallback> cb = new JCPostInvCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}
break;
case LLAssetType::AT_LSL_TEXT:
{
LLPointer<LLInventoryCallback> cb = new JCPostInvCallback(data);
LLPermissions perm;
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
LLFloaterPerms::getNextOwnerPerms(),
cb);
}
break;
case LLAssetType::AT_SCRIPT://this shouldn't happen as this is legacy shit
case LLAssetType::AT_GESTURE://we don't import you atm...
default:
break;
}
asset_insertions += 1;
}
}
}
}