diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-02-04 14:12:38 +0200 |
|---|---|---|
| committer | Andrey Lihatskiy <118752495+marchcat@users.noreply.github.com> | 2026-02-04 17:31:52 +0200 |
| commit | 7e37e97cee0fc30af56297089eeecb8ca807d9c2 (patch) | |
| tree | f52a8e79dd4b9fe44d70074786711495da4f3a20 | |
| parent | 37824a0b61cc28caab2454456d592671d106a343 (diff) | |
#5359 Skip SLua scripts during bulk LSL recompile
| -rw-r--r-- | indra/newview/llcompilequeue.cpp | 28 | ||||
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llpreviewscript.h | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_script_queue.xml | 4 |
4 files changed, 35 insertions, 1 deletions
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 993b30a014..e0f464168c 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -61,6 +61,7 @@ #include "llviewerassetupload.h" #include "llcorehttputil.h" +#include "llpreviewscript.h" namespace { @@ -462,6 +463,33 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat LLUUID assetId = result["asset_id"]; + // Check if this is a SLua script that shouldn't be recompiled to Mono/LSL + if (compile_target == "mono" || compile_target == "lsl2") + { + // Read the script from cache to check its type + LLFileSystem file(assetId, LLAssetType::AT_LSL_TEXT, LLFileSystem::READ); + if (file.getSize() > 0) + { + S32 file_length = file.getSize(); + std::vector<char> buffer(file_length + 1); + file.read((U8*)&buffer[0], file_length); + buffer[file_length] = 0; + std::string script_text(&buffer[0]); + + if (is_lua_script(script_text)) + { + // This is a SLua script - skip it with a warning + LLStringUtil::format_map_t args; + args["[SCRIPT_NAME]"] = inventory->getName(); + args["[TARGET]"] = (compile_target == "mono") ? "Mono" : "LSL"; + std::string buffer = floater->getString("SkippingSluaScript", args); + floater->addStringMessage(buffer); + LL_INFOS("SCRIPTQ") << "Skipping SLua script: " << inventory->getName() << LL_ENDL; + return true; + } + } + } + std::string url = object->getRegion()->getCapability("UpdateScriptTask"); { diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 3eadca7a40..da788775f1 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -125,7 +125,7 @@ static bool have_lua_enabled(const LLUUID& object_id) // TEMPORARY: Quick check to see if the code is Lua // since we don't have another way to determine the language yet -static bool is_lua_script(const std::string& code) +bool is_lua_script(const std::string& code) { // Check for LSL's signature "default" state pattern std::regex lsl_pattern("\\s*default\\s*\\{"); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 922a0f2a38..a85837065e 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -56,6 +56,8 @@ class LLFloaterExperienceProfile; class LLScriptMovedObserver; class LLScriptEditorWSServer; +bool is_lua_script(const std::string& code); + class LLLiveLSLFile : public LLLiveFile { public: diff --git a/indra/newview/skins/default/xui/en/floater_script_queue.xml b/indra/newview/skins/default/xui/en/floater_script_queue.xml index a98437ab1d..e272d3073a 100644 --- a/indra/newview/skins/default/xui/en/floater_script_queue.xml +++ b/indra/newview/skins/default/xui/en/floater_script_queue.xml @@ -37,6 +37,10 @@ name="LoadingObjInv"> Loading inventory for: [OBJECT_NAME] </floater.string> + <floater.string + name="SkippingSluaScript"> + Skipping SLua script "[SCRIPT_NAME]" (cannot recompile to [TARGET]) + </floater.string> <button follows="right|bottom" height="24" |
