summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-02Add 'UI' 'getParents' op to list top-menu 'parent_menu' names.Nat Goodspeed
2024-08-02Merge pull request #2174 from secondlife/lua-callablesnat-goodspeed
Add UI.callables() and corresponding entry point.
2024-08-01Merge branch 'lua-top-menu' of github.com:secondlife/viewer into lua-callablesNat Goodspeed
2024-08-01Merge branch 'release/luau-scripting' into lua-top-menuNat Goodspeed
2024-08-01Add UI.callables() and corresponding entry point.Nat Goodspeed
2024-08-01Merge remote-tracking branch 'origin/lua-top-menu' into lua-callables.Nat Goodspeed
We want to base lua-callables on lua-top-menu.
2024-08-01Add lua_push(), lua_to(), lua_[gs]etfieldv(), lua_raw[gs]etfield().Nat Goodspeed
Leverage C++ overloads to allow use of generic function names disambiguated by argument type. This allows using templates for certain common operation sequences.
2024-07-31Merge pull request #2118 from secondlife/lua-cameraMaxim Nikolenko
Lua api for Follow Camera control
2024-07-31Represent the many "LLAgent" "setCameraParams" args in an array.nat-goodspeed
This encapsulates the boilerplate associated with passing each distinct parameter to its corresponding LLFollowCamMgr method.
2024-07-29Merge branch 'release/luau-scripting' into lua-top-menuMaxim Nikolenko
2024-07-29Merge branch 'release/luau-scripting' into lua-cameraMaxim Nikolenko
2024-07-29Update expired cert in integration test (#2140)Maxim Nikolenko
see fe8c976 for more info Co-authored-by: Andrey Lihatskiy <alihatskiy@productengine.com>
2024-07-26Add api for more script camera paramsMnikolenko Productengine
2024-07-25Script clean upMnikolenko Productengine
2024-07-25Lua api for Follow Camera controlMnikolenko Productengine
2024-07-18Merge pull request #2068 from secondlife/lua-pump-notracknat-goodspeed
Allow `LLEventPump` listener access to its own `LLBoundListener`.
2024-07-18Guarantee that the "login" LLEventPump has exactly that name.Nat Goodspeed
We used to allow "tweaking" the name. Don't.
2024-07-18Improve viewer's defense against `LLEventAPI` failures.Nat Goodspeed
`LLEventAPI` is specifically intended to allow a LEAP plugin, or a Lua script, to access certain viewer functionality. Errors in external code like that cannot be addressed during viewer development. Any code path that allows external code in any form to crash the viewer opens up a potential abuse vector, if a trusting user runs external code from an untrustworthy source. `LLDispatchListener` reports exceptions back to its invoker, if the invoker provides a "reply" `LLEventPump` name. Absent "reply", though, `LLDispatchListener` is documented to let any such exception propagate. That behavior may be okay for internal use, but in the case of the `LLEventAPI` subclass, it veers into the abuse scenario described above. Make `LLEventAPI` ensure that any exception propagating from `LLDispatchListener` is caught and logged, but not propagated. Also enrich error reporting for the "batch" `LLDispatchListener` operations.
2024-07-18Ditch `LLEventTrackable` aka `boost::signals2::trackable`.Nat Goodspeed
Remove documented `LLEventPump` support for `LLEventTrackable`. That claimed support was always a little bit magical/fragile. IF: * a class included `LLEventTrackable` as a base class AND * an instance of that class was managed by `boost::shared_ptr` AND * you passed one of that class's methods and the `boost::shared_ptr` specifically to `boost::bind()` AND * the resulting `boost::bind()` object was passed into `LLEventPump::listen()` THEN the promise was that on destruction of that object, that listener would automatically be disconnected -- instead of leaving a dangling pointer bound into the `LLEventPump`, causing a crash on the next `LLEventPump::post()` call. The only existing code in the viewer code base that exercised `LLEventTrackable` functionality was in test programs. When the viewer calls `LLEventPump::listen()`, it typically stores the resulting connection object in an `LLTempBoundListener` variable, which guarantees disconnection on destruction of that variable. The fact that `LLEventTrackable` support is specific to `boost::bind()`, that it silently fails to keep its promise with `std::bind()` or a lambda or any other form of C++ callable, makes it untrustworthy for new code. Note that the code base still uses `boost::signals2::trackable` for other `boost::signals2::signal` instances not associated with `LLEventPump`. We are not changing those at this time.
2024-07-18Make `LLEventPump::listen()` also accept new `LLAwareListener`.Nat Goodspeed
`listen()` still takes `LLEventListener`, a `callable(const LLSD&)`, but now also accepts `LLAwareListener`, a `callable(const LLBoundListener&, const LLSD&)`. This uses `boost::signals2::signal::connect_extended()`, which, when the signal is called, passes to a connected listener the `LLBoundListener` (aka `boost::signals2::connection`) representing its own connection. This allows a listener to disconnect itself when done. Internally, `listen_impl()` now always uses `connect_extended()`. When passed a classic `LLEventListener`, `listen()` wraps it in a lambda that ignores the passed `LLBoundListener`. `listen()` also now accepts `LLVoidListener`, and internally wraps it in a lambda that returns `false` on its behalf.
2024-07-17Lua api for adding new menu items to the Top menuMaxim Nikolenko
2024-07-12Merge pull request #2009 from secondlife/lua-llsd-debug-settingnat-goodspeed
Show description and actual value of LLSD type setting
2024-07-12fix for 'Run' buttonMnikolenko Productengine
2024-07-12Show description and actual value of LLSD type settingMnikolenko Productengine
2024-07-11Merge pull request #1984 from secondlife/lua-no-reusenat-goodspeed
Remove ability to reuse a `LuaState` between `LLLUAmanager` functions.
2024-07-10Merge branch 'lua-atexit-run' into lua-no-reuse.Nat Goodspeed
We couldn't discard the "p.s." fiber.run() call from LuaState::expr() until we could count on fiber.lua's LL.atexit(fiber.run) call being executed after each Lua script or chunk, and we couldn't count on that until we made LLLUAmanager::runScriptFile() instantiate and destroy its LuaState on the C++ Lua-specific coroutine. Now that we've done that, use LL.atexit(fiber.run) instead of the whole special-case "p.s." in LuaState::expr().
2024-07-10Remove ability to reuse a LuaState between LLLUAmanager functions.Nat Goodspeed
Remove LLLUAmanager::mumbleScriptLine() LuaState& parameters. Make startScriptLine(), waitScriptLine() and runScriptLine() exactly parallel to startScriptFile(), waitScriptFile() and runScriptFile(). That means that runScriptLine()'s C++ coroutine instantiates and destroys its own LuaState, which means that LL.atexit() functions will run on the Lua-specific C++ coroutine rather than (say) the viewer's main coroutine. Introduce LLLUAmanager::script_result typedef for std::pair<int, LLSD> and use in method returns. Remove LuaState::initLuaState(); move its logic back into the constructor. Remove initLuaState() calls in the expr() error cases: they're moot now that we won't get subsequent expr() calls on the same LuaState instance. Remove LLFloaterLUADebug "Use clean lua_State" checkbox and the cleanLuaState() method. Remove mState member. Remove explicit LuaState declarations from LLLUAmanager tests. Adapt one test for implicit LuaState: it was directly calling LuaState::obtainListener() to discover the LuaListener's reply-pump name. But since that test also captures two leap.request() calls from the Lua script, it can just look at the "reply" key in either of those requests.
2024-07-10Merge pull request #1939 from secondlife/lua-snapshotMaxim Nikolenko
Lua api for Snapshot and demo script
2024-07-10Simplify passing keys to leap.requestMnikolenko Productengine
2024-07-09Merge branch 'release/luau-scripting' into lua-snapshotNat Goodspeed
2024-07-09Merge pull request #1958 from secondlife/lua-appearance-listener-combinenat-goodspeed
Break out common `LLAppearanceMgr::wearOutfit(LLInventoryCategory*)` method
2024-07-09Merge branch 'release/luau-scripting' into lua-snapshotNat Goodspeed
2024-07-09Merge branch 'release/luau-scripting' into lua-appearance-listener-combineNat Goodspeed
2024-07-09Introduce LLSDParam<vector<T>> and LLSDParam<map<string, T>>.Nat Goodspeed
Use LLSDParam<uuid_vec_t> in LLAppearanceListener::wearItems() and detachItems() to build the vector of LLUUIDs from the passed LLSD array.
2024-07-09Merge pull request #1892 from secondlife/lua-appearance-listenernat-goodspeed
Lua appearance listener
2024-07-08The I/O manipulator std::quoted() must be passed to an ostream.Nat Goodspeed
2024-07-08Slightly simplify LLAppearanceListener::wearItems(), detachItems().Nat Goodspeed
2024-07-08Combine LLAppearanceMgr::wearOutfit() and wearOutfitByName()Nat Goodspeed
into new private wearOutfit(LLInventoryCategory*) method.
2024-07-08Quote "LLAppearance" op="wearOutfit" folder_id and folder_name argsNat Goodspeed
2024-07-08Lua api for Snapshot and demo scriptMnikolenko Productengine
2024-07-05clean up and rename demo scriptMnikolenko Productengine
2024-07-04Use llsd::toMap() to return LLSD maps from "LLAppearance" listener. Maxim Nikolenko
Use llsd::toMap() to return LLSD maps from "LLAppearance" listener.
2024-07-03Use llsd::toMap() to return LLSD maps from "LLAppearance" listener.Nat Goodspeed
2024-07-03Merge branch 'release/luau-scripting' into lua-appearance-listener-tomapNat Goodspeed
2024-07-03Add llsd::toArray() and llsd::toMap() utility functions.Nat Goodspeed
These encapsulate looping over a C++ iterable (be it a sequence container or an associative container) and returning an LLSD array or map, respectively, derived from the C++ container. By default, each C++ container item is directly converted to LLSD. Also make LLSDParam<LLSD> slightly more efficient by using std::vector::emplace_back() instead of push_back(), which supports std::vector<std::unique_ptr>, so we need not use std::shared_ptr.
2024-07-02Merge branch 'release/luau-scripting' into lua-appearance-listenerNat Goodspeed
2024-07-02Merge pull request #1878 from secondlife/lua-pathsnat-goodspeed
Add LuaAutorunPath, LuaCommandPath and LuaRequirePath settings.
2024-07-02Merge branch 'release/luau-scripting' into lua-appearance-listenerNat Goodspeed
2024-07-02Eliminate c_str() calls from LLControlGroup::loadFromFile() calls.Nat Goodspeed
Passing std::string::c_str() to a (const std::string&) function parameter is worse than clutter, it's pointless overhead: it forces the compiler to construct a new std::string instance, instead of passing a const reference to the one you already have in hand.
2024-07-02Merge branch 'release/luau-scripting' into lua-pathsNat Goodspeed