本文整理汇总了C++中LLFloaterCompileQueue::getKey方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterCompileQueue::getKey方法的具体用法?C++ LLFloaterCompileQueue::getKey怎么用?C++ LLFloaterCompileQueue::getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterCompileQueue
的用法示例。
在下文中一共展示了LLFloaterCompileQueue::getKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scriptArrived
// This is the callback for when each script arrives
// static
void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
llinfos << "LLFloaterCompileQueue::scriptArrived()" << llendl;
LLScriptQueueData* data = (LLScriptQueueData*)user_data;
if(!data)
{
return;
}
LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID);
std::string buffer;
if(queue && (0 == status))
{
//llinfos << "ITEM NAME 3: " << data->mScriptName << llendl;
// Dump this into a file on the local disk so we can compile it.
std::string filename;
LLVFile file(vfs, asset_id, type);
std::string uuid_str;
asset_id.toString(uuid_str);
filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str) + llformat(".%s",LLAssetType::lookup(type));
const bool is_running = true;
LLViewerObject* object = gObjectList.findObject(data->mTaskId);
if (object)
{
std::string url = object->getRegion()->getCapability("UpdateScriptTask");
if(!url.empty())
{
// Read script source in to buffer.
U32 script_size = file.getSize();
U8* script_data = new U8[script_size];
file.read(script_data, script_size);
queue->mUploadQueue->queue(filename, data->mTaskId,
data->mItemId, is_running, queue->mMono, queue->getKey().asUUID(),
script_data, script_size, data->mScriptName);
}
else
{
// It's now in the file, now compile it.
buffer = LLTrans::getString("CompileQueueDownloadedCompiling") + (": ") + data->mScriptName;
// Write script to local file for compilation.
LLFILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
if (fp)
{
const S32 buf_size = 65536;
U8 copy_buf[buf_size];
while (file.read(copy_buf, buf_size)) /*Flawfinder: ignore*/
{
if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1)
{
// return a bad file error if we can't write the whole thing
status = LL_ERR_CANNOT_OPEN_FILE;
}
}
fclose(fp);
}
else
{
llerrs << "Unable to find object to compile" << llendl;
}
// TODO: babbage: No compile if no cap.
queue->compile(filename, data->mItemId);
// Delete it after we're done compiling?
LLFile::remove(filename);
}
}
}
else
{
LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status )
{
LLSD args;
args["MESSAGE"] = LLTrans::getString("CompileQueueScriptNotFound");
LLNotificationsUtil::add("SystemMessage", args);
buffer = LLTrans::getString("CompileQueueProblemDownloading") + (": ") + data->mScriptName;
}
else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status)
{
LLSD args;
args["MESSAGE"] = LLTrans::getString("CompileQueueInsufficientPermDownload");
LLNotificationsUtil::add("SystemMessage", args);
buffer = LLTrans::getString("CompileQueueInsufficientPermFor") + (": ") + data->mScriptName;
}
else
{
//.........这里部分代码省略.........