diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2024-08-27 17:35:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 17:35:24 +0300 |
commit | c225b44a59ddd6b84105ace4181b3ca9f7439bfa (patch) | |
tree | e79d4f065c1d47ce9e9bbd2f2f20d089c7c9027c /indra/llcommon | |
parent | 3919e85f89d2d95af3bd4b824293d6eda6a80162 (diff) | |
parent | 27ce2a23a286709c90579db31c2551e0c3f292e7 (diff) |
Merge pull request #2384 from secondlife/lua-inventory
Lua inventory api
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llassettype.cpp | 17 | ||||
-rw-r--r-- | indra/llcommon/llassettype.h | 2 | ||||
-rw-r--r-- | indra/llcommon/lua_function.cpp | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 3e46bde954..00c61c6e0a 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -30,6 +30,7 @@ #include "lldictionary.h" #include "llmemory.h" #include "llsingleton.h" +#include "llsd.h" ///---------------------------------------------------------------------------- /// Class LLAssetType @@ -244,3 +245,19 @@ bool LLAssetType::lookupIsAssetIDKnowable(EType asset_type) } return false; } + +LLSD LLAssetType::getTypeNames() +{ + LLSD type_names; + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + for (S32 type = 0; type < AT_COUNT; ++type) + { + const AssetEntry *entry = dict->lookup(LLAssetType::EType(type)); + // skip llassettype_bad_lookup + if (entry) + { + type_names.append(entry->mTypeName); + } + } + return type_names; +} diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 1989155550..4185063ae5 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -163,6 +163,8 @@ public: static bool lookupIsAssetFetchByIDAllowed(EType asset_type); // the asset allows direct download static bool lookupIsAssetIDKnowable(EType asset_type); // asset data can be known by the viewer + static LLSD getTypeNames(); + static const std::string BADLOOKUP; protected: diff --git a/indra/llcommon/lua_function.cpp b/indra/llcommon/lua_function.cpp index 452bc24b16..880bc209f6 100644 --- a/indra/llcommon/lua_function.cpp +++ b/indra/llcommon/lua_function.cpp @@ -35,7 +35,7 @@ using namespace std::literals; // e.g. std::string_view literals: "this"sv -const S32 INTERRUPTS_MAX_LIMIT = 20000; +const S32 INTERRUPTS_MAX_LIMIT = 100000; const S32 INTERRUPTS_SUSPEND_LIMIT = 100; #define lua_register(L, n, f) (lua_pushcfunction(L, (f), n), lua_setglobal(L, (n))) |