本文整理汇总了C++中LLAgent::getSecureSessionID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAgent::getSecureSessionID方法的具体用法?C++ LLAgent::getSecureSessionID怎么用?C++ LLAgent::getSecureSessionID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAgent
的用法示例。
在下文中一共展示了LLAgent::getSecureSessionID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dupliAnim
void LLPreviewAnim::dupliAnim( void *userdata )
{
LLPreviewAnim* self = (LLPreviewAnim*) userdata;
//if(!self->childGetValue("Anim play btn").asBoolean())
//{
// printchat("anim must be playing to copy by this method; please try again");
// LLPreviewAnim::playAnim( userdata );
// return;
//}
const LLInventoryItem *item = self->getItem();
if(item)
{
if(self->mAnimBuffer == NULL)
{
return;
}
LLKeyframeMotion* motionp = NULL;
//LLBVHLoader* loaderp = NULL;
LLAssetID xMotionID;
LLTransactionID xTransactionID;
// generate unique id for this motion
xTransactionID.generate();
xMotionID = xTransactionID.makeAssetID(gAgent.getSecureSessionID());
motionp = (LLKeyframeMotion*)gAgent.getAvatarObject()->createMotion(xMotionID);
/*
// pass animation data through memory buffer
//loaderp->serialize(dp);
gAgent.getAvatarObject()->startMotion(item->getAssetUUID());
LLVOAvatar* avatar = gAgent.getAvatarObject();
LLMotion* motion = avatar->findMotion(item->getAssetUUID());
LLKeyframeMotion* tmp = (LLKeyframeMotion*)motion;
S32 file_size = tmp->getFileSize();
U8* buffer = new U8[file_size];
LLDataPackerBinaryBuffer dp(buffer, file_size);*/
LLDataPackerBinaryBuffer dp(self->mAnimBuffer, self->mAnimBufferSize);
LLVOAvatar* avatar = gAgent.getAvatarObject();
LLMotion* motion = avatar->findMotion(item->getAssetUUID());
LLKeyframeMotion* tmp = (LLKeyframeMotion*)motion;
tmp->serialize(dp);
dp.reset();
BOOL success = motionp && motionp->deserialize(dp);
//delete []buffer;
if (success)
{
motionp->setName(item->getName());
gAgent.getAvatarObject()->startMotion(xMotionID);
////////////////////////////////////////////////////////////////////
/*LLKeyframeMotion* */motionp = (LLKeyframeMotion*)gAgent.getAvatarObject()->findMotion(xMotionID);
S32 file_size = motionp->getFileSize();
U8* buffer = new U8[file_size];
LLDataPackerBinaryBuffer dp(buffer, file_size);
if (motionp->serialize(dp))
{
LLVFile file(gVFS, motionp->getID(), LLAssetType::AT_ANIMATION, LLVFile::APPEND);
S32 size = dp.getCurrentSize();
file.setMaxSize(size);
if (file.write((U8*)buffer, size))
{
std::string name = item->getName();
std::string desc = item->getDescription();
upload_new_resource(xTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLAssetType::AT_NONE,
LLInventoryType::IT_ANIMATION,
PERM_NONE,PERM_NONE,PERM_NONE,
name,0,10,0);
}
else
{
llwarns << "Failure writing animation data." << llendl;
LLNotifications::instance().add("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
gAgent.getAvatarObject()->removeMotion(xMotionID);
LLKeyframeDataCache::removeKeyframeData(xMotionID);
////////////////////////////////////////////////////////////////////
//.........这里部分代码省略.........
示例2: send_inventory
void ImportTracker::send_inventory(LLSD& prim)
{
U32 local_id = prim["LocalID"].asInteger();
if (prim.has("inventory"))
{
std::string assetpre = asset_dir + gDirUtilp->getDirDelimiter();
LLSD inventory = prim["inventory"];
for (LLSD::array_iterator inv = inventory.beginArray(); inv != inventory.endArray(); ++inv)
{
LLSD item = (*inv);
InventoryImportInfo* data = new InventoryImportInfo;
data->localid = local_id;
LLTransactionID tid;
tid.generate();
LLUUID assetid = tid.makeAssetID(gAgent.getSecureSessionID());
data->tid = tid;
data->assetid = assetid;
data->type = LLAssetType::lookup(item["type"].asString());////LLAssetType::EType(U32(item["type"].asInteger()));
data->name = item["name"].asString();
data->description = item["desc"].asString();
if(item.has("item_id"))
{
//cmdline_printchat("item id found");
std::string filename = assetpre + item["item_id"].asString() + "." + item["type"].asString();
//S32 file_size;
//LLAPRFile infile ;
//infile.open(filename, LL_APR_RB, NULL, &file_size);
//apr_file_t* fp = infile.getFileHandle();
//if(fp)
if(LLFile::isfile(filename))
{
//cmdline_printchat("file "+filename+" exists");
data->filename = filename;
//infile.close();
}else
{
//cmdline_printchat("file "+filename+" does not exist");
delete data;
continue;
}
}else
{
//cmdline_printchat("item id not found");
delete data;
continue;
}
data->wear_type = NOT_WEARABLE;
//if(data->type == LLAssetType::AT_LSL_TEXT)
{
data->inv_type = LLInventoryType::defaultForAssetType(data->type);
//printchat("is script");
data->compiled = false;
//
switch(data->type)
{
case LLAssetType::AT_TEXTURE:
case LLAssetType::AT_TEXTURE_TGA:
//cmdline_printchat("case textures");
{
std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
S32 file_size;
LLAPRFile infile ;
infile.open(data->filename, LL_APR_RB, NULL, &file_size);
if (infile.getFileHandle())
{
//cmdline_printchat("got file handle");
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())
//.........这里部分代码省略.........