diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 12:18:31 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 12:18:31 -0400 |
commit | 7ccf02515ad3f9e3bf795d651fe4b3c0d773f353 (patch) | |
tree | c4adc897c07f652e617e91fbf41c12b823acc808 /indra/newview/llcompilequeue.cpp | |
parent | 1abf5f18d6afc7ae9e1b1562b92e5c1ce33b722f (diff) | |
parent | e7eced3c87310b15ac20cc3cd470d67686104a14 (diff) |
Merge commit 'e7eced3' into lua-timers for whitespace fixes.
Diffstat (limited to 'indra/newview/llcompilequeue.cpp')
-rw-r--r-- | indra/newview/llcompilequeue.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index b11786a451..eebef4cc1c 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llcompilequeue.cpp * @brief LLCompileQueueData class implementation * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -27,7 +27,7 @@ /** * * Implementation of the script queue which keeps an array of object - * UUIDs and manipulates all of the scripts on each of them. + * UUIDs and manipulates all of the scripts on each of them. * */ @@ -67,8 +67,8 @@ namespace const std::string QUEUE_EVENTPUMP_NAME("ScriptActionQueue"); - // ObjectIventoryFetcher is an adapter between the LLVOInventoryListener::inventoryChanged - // callback mechanism and the LLEventPump coroutine architecture allowing the + // ObjectIventoryFetcher is an adapter between the LLVOInventoryListener::inventoryChanged + // callback mechanism and the LLEventPump coroutine architecture allowing the // coroutine to wait for the inventory event. class ObjectInventoryFetcher: public LLVOInventoryListener { @@ -87,7 +87,7 @@ namespace S32 serial_num, void* user_data); - void fetchInventory() + void fetchInventory() { requestVOInventory(); } @@ -115,15 +115,15 @@ namespace } -// *NOTE$: A minor specialization of LLScriptAssetUpload, it does not require a buffer -// (and does not save a buffer to the cache) and it finds the compile queue window and +// *NOTE$: A minor specialization of LLScriptAssetUpload, it does not require a buffer +// (and does not save a buffer to the cache) and it finds the compile queue window and // displays a compiling message. class LLQueuedScriptAssetUpload : public LLScriptAssetUpload { public: LLQueuedScriptAssetUpload(LLUUID taskId, LLUUID itemId, LLUUID assetId, TargetType_t targetType, bool isRunning, std::string scriptName, LLUUID queueId, LLUUID exerienceId, taskUploadFinish_f finish) : - LLScriptAssetUpload(taskId, itemId, targetType, isRunning, + LLScriptAssetUpload(taskId, itemId, targetType, isRunning, exerienceId, std::string(), finish, nullptr), mScriptName(scriptName), mQueueId(queueId) @@ -133,8 +133,8 @@ public: virtual LLSD prepareUpload() { - /* *NOTE$: The parent class (LLScriptAssetUpload will attempt to save - * the script buffer into to the cache. Since the resource is already in + /* *NOTE$: The parent class (LLScriptAssetUpload will attempt to save + * the script buffer into to the cache. Since the resource is already in * the cache we don't want to do that. Just put a compiling message in * the window and move on */ @@ -165,14 +165,14 @@ private: struct LLScriptQueueData { - LLUUID mQueueID; - LLUUID mTaskId; - LLPointer<LLInventoryItem> mItem; - LLHost mHost; - LLUUID mExperienceId; - std::string mExperiencename; - LLScriptQueueData(const LLUUID& q_id, const LLUUID& task_id, LLInventoryItem* item) : - mQueueID(q_id), mTaskId(task_id), mItem(new LLInventoryItem(item)) {} + LLUUID mQueueID; + LLUUID mTaskId; + LLPointer<LLInventoryItem> mItem; + LLHost mHost; + LLUUID mExperienceId; + std::string mExperiencename; + LLScriptQueueData(const LLUUID& q_id, const LLUUID& task_id, LLInventoryItem* item) : + mQueueID(q_id), mTaskId(task_id), mItem(new LLInventoryItem(item)) {} }; @@ -182,11 +182,11 @@ struct LLScriptQueueData // Default constructor LLFloaterScriptQueue::LLFloaterScriptQueue(const LLSD& key) : - LLFloater(key), - mDone(false), - mMono(false) + LLFloater(key), + mDone(false), + mMono(false) { - + } // Destroys the object @@ -196,17 +196,17 @@ LLFloaterScriptQueue::~LLFloaterScriptQueue() BOOL LLFloaterScriptQueue::postBuild() { - childSetAction("close",onCloseBtn,this); - getChildView("close")->setEnabled(FALSE); - setVisible(true); - return TRUE; + childSetAction("close",onCloseBtn,this); + getChildView("close")->setEnabled(FALSE); + setVisible(true); + return TRUE; } // static void LLFloaterScriptQueue::onCloseBtn(void* user_data) { - LLFloaterScriptQueue* self = (LLFloaterScriptQueue*)user_data; - self->closeFloater(); + LLFloaterScriptQueue* self = (LLFloaterScriptQueue*)user_data; + self->closeFloater(); } void LLFloaterScriptQueue::addObject(const LLUUID& id, std::string name) @@ -217,16 +217,16 @@ void LLFloaterScriptQueue::addObject(const LLUUID& id, std::string name) BOOL LLFloaterScriptQueue::start() { - std::string buffer; + std::string buffer; - LLStringUtil::format_map_t args; - args["[START]"] = mStartString; - args["[COUNT]"] = llformat ("%d", mObjectList.size()); - buffer = getString ("Starting", args); - - getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM); + LLStringUtil::format_map_t args; + args["[START]"] = mStartString; + args["[COUNT]"] = llformat ("%d", mObjectList.size()); + buffer = getString ("Starting", args); - return startQueue(); + getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM); + + return startQueue(); } void LLFloaterScriptQueue::addProcessingMessage(const std::string &message, const LLSD &args) @@ -244,7 +244,7 @@ void LLFloaterScriptQueue::addStringMessage(const std::string &message) BOOL LLFloaterScriptQueue::isDone() const { - return (mCurrentObjectID.isNull() && (mObjectList.size() == 0)); + return (mCurrentObjectID.isNull() && (mObjectList.size() == 0)); } ///---------------------------------------------------------------------------- @@ -253,29 +253,29 @@ BOOL LLFloaterScriptQueue::isDone() const LLFloaterCompileQueue::LLFloaterCompileQueue(const LLSD& key) : LLFloaterScriptQueue(key) { - setTitle(LLTrans::getString("CompileQueueTitle")); - setStartString(LLTrans::getString("CompileQueueStart")); - + setTitle(LLTrans::getString("CompileQueueTitle")); + setStartString(LLTrans::getString("CompileQueueStart")); + } LLFloaterCompileQueue::~LLFloaterCompileQueue() -{ +{ } void LLFloaterCompileQueue::experienceIdsReceived( const LLSD& content ) { - for(LLSD::array_const_iterator it = content.beginArray(); it != content.endArray(); ++it) - { - mExperienceIds.insert(it->asUUID()); - } + for(LLSD::array_const_iterator it = content.beginArray(); it != content.endArray(); ++it) + { + mExperienceIds.insert(it->asUUID()); + } } BOOL LLFloaterCompileQueue::hasExperience( const LLUUID& id ) const { - return mExperienceIds.find(id) != mExperienceIds.end(); + return mExperienceIds.find(id) != mExperienceIds.end(); } -// //Attempt to record this asset ID. If it can not be inserted into the set +// //Attempt to record this asset ID. If it can not be inserted into the set // //then it has already been processed so return false. void LLFloaterCompileQueue::handleHTTPResponse(std::string pumpName, const LLSD &expresult) @@ -284,10 +284,10 @@ void LLFloaterCompileQueue::handleHTTPResponse(std::string pumpName, const LLSD } // *TODO: handleSCriptRetrieval is passed into the cache via a legacy C function pointer -// future project would be to convert these to C++ callables (std::function<>) so that +// future project would be to convert these to C++ callables (std::function<>) so that // we can use bind and remove the userData parameter. -// -void LLFloaterCompileQueue::handleScriptRetrieval(const LLUUID& assetId, +// +void LLFloaterCompileQueue::handleScriptRetrieval(const LLUUID& assetId, LLAssetType::EType type, void* userData, S32 status, LLExtStat extStatus) { LLSD result(LLSD::emptyMap()); @@ -296,7 +296,7 @@ void LLFloaterCompileQueue::handleScriptRetrieval(const LLUUID& assetId, if (status) { result["error"] = status; - + if (status == LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE) { result["message"] = LLTrans::getString("CompileQueueProblemDownloading") + (":"); @@ -404,7 +404,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat experienceId = result[LLExperienceCache::EXPERIENCE_ID].asUUID(); if (!floater->hasExperience(experienceId)) { - floater->addProcessingMessage("CompileNoExperiencePerm", + floater->addProcessingMessage("CompileNoExperiencePerm", LLSDMap("SCRIPT", inventory->getName()) ("EXPERIENCE", result[LLExperienceCache::NAME].asString())); return true; @@ -468,14 +468,14 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat std::string url = object->getRegion()->getCapability("UpdateScriptTask"); { - LLResourceUploadInfo::ptr_t uploadInfo(new LLQueuedScriptAssetUpload(object->getID(), - inventory->getUUID(), - assetId, + LLResourceUploadInfo::ptr_t uploadInfo(new LLQueuedScriptAssetUpload(object->getID(), + inventory->getUUID(), + assetId, monocompile ? LLScriptAssetUpload::MONO : LLScriptAssetUpload::LSL2, - true, - inventory->getName(), - LLUUID(), - experienceId, + true, + inventory->getName(), + LLUUID(), + experienceId, boost::bind(&LLFloaterCompileQueue::handleHTTPResponse, pump.getName(), _4))); LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); @@ -552,12 +552,12 @@ bool LLFloaterCompileQueue::startQueue() LLFloaterResetQueue::LLFloaterResetQueue(const LLSD& key) : LLFloaterScriptQueue(key) { - setTitle(LLTrans::getString("ResetQueueTitle")); - setStartString(LLTrans::getString("ResetQueueStart")); + setTitle(LLTrans::getString("ResetQueueTitle")); + setStartString(LLTrans::getString("ResetQueueStart")); } LLFloaterResetQueue::~LLFloaterResetQueue() -{ +{ } /// This is a utility function to be bound and called from objectScriptProcessingQueueCoro. @@ -572,7 +572,7 @@ bool LLFloaterResetQueue::resetObjectScripts(LLHandle<LLFloaterScriptQueue> hflo std::string buffer; buffer = floater->getString("Resetting") + (": ") + inventory->getName(); floater->addStringMessage(buffer); - + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); msg->nextBlockFast(_PREHASH_AgentData); @@ -609,12 +609,12 @@ bool LLFloaterResetQueue::startQueue() LLFloaterRunQueue::LLFloaterRunQueue(const LLSD& key) : LLFloaterScriptQueue(key) { - setTitle(LLTrans::getString("RunQueueTitle")); - setStartString(LLTrans::getString("RunQueueStart")); + setTitle(LLTrans::getString("RunQueueTitle")); + setStartString(LLTrans::getString("RunQueueStart")); } LLFloaterRunQueue::~LLFloaterRunQueue() -{ +{ } /// This is a utility function to be bound and called from objectScriptProcessingQueueCoro. @@ -666,17 +666,17 @@ bool LLFloaterRunQueue::startQueue() LLFloaterNotRunQueue::LLFloaterNotRunQueue(const LLSD& key) : LLFloaterScriptQueue(key) { - setTitle(LLTrans::getString("NotRunQueueTitle")); - setStartString(LLTrans::getString("NotRunQueueStart")); + setTitle(LLTrans::getString("NotRunQueueTitle")); + setStartString(LLTrans::getString("NotRunQueueStart")); } LLFloaterNotRunQueue::~LLFloaterNotRunQueue() -{ +{ } /// This is a utility function to be bound and called from objectScriptProcessingQueueCoro. /// Do not call directly. It may throw a LLCheckedHandle<>::Stale exception. -bool LLFloaterNotRunQueue::stopObjectScripts(LLHandle<LLFloaterScriptQueue> hfloater, +bool LLFloaterNotRunQueue::stopObjectScripts(LLHandle<LLFloaterScriptQueue> hfloater, const LLPointer<LLViewerObject> &object, LLInventoryObject* inventory, LLEventPump &pump) { LLCheckedHandle<LLFloaterScriptQueue> floater(hfloater); @@ -732,8 +732,8 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L object_data_list_t objectList, fnQueueAction_t func) { LLCoros::set_consuming(true); - LLCheckedHandle<LLFloaterScriptQueue> floater(hfloater); - // Dereferencing floater may fail. If they do they throw LLExeceptionStaleHandle. + LLCheckedHandle<LLFloaterScriptQueue> floater(hfloater); + // Dereferencing floater may fail. If they do they throw LLExeceptionStaleHandle. // This is expected if the dialog closes. LLEventMailDrop maildrop(QUEUE_EVENTPUMP_NAME, true); F32 fetch_timeout = gSavedSettings.getF32("QueueInventoryFetchTimeout"); @@ -792,7 +792,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L { floater.check(); - // note, we have a smart pointer to the obj above... but if we didn't we'd check that + // note, we have a smart pointer to the obj above... but if we didn't we'd check that // it still exists here. if (((*itInv)->getType() == LLAssetType::AT_LSL_TEXT)) @@ -822,7 +822,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L } catch (LLCheckedHandleBase::Stale &) { - // This is expected. It means that floater has been closed before + // This is expected. It means that floater has been closed before // processing was completed. LL_DEBUGS("SCRIPTQ") << "LLExeceptionStaleHandle caught! Floater has most likely been closed." << LL_ENDL; } |