summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-29Add Lua script name to log messages.Nat Goodspeed
2024-08-28Prevent erroneous assignment to LL.setdtor() proxy._target field.Nat Goodspeed
Trim redundant output from test_setdtor.lua.
2024-08-28Add `LL.setdtor()` function to add a "destructor" to any Lua object.Nat Goodspeed
`setdtor('description', object, function)` returns a proxy userdata object referencing object and function. When the proxy is garbage-collected, or at the end of the script, its destructor calls `function(object)`. The original object may be retrieved as `proxy._target`, e.g. to pass it to the `table` library. The proxy also has a metatable with metamethods supporting arithmetic operations, string concatenation, length and table indexing. For other operations, retrieve `proxy._target`. (But don't assign to `proxy._target`. It will appear to work, in that subsequent references to `proxy._target` will retrieve the replacement object -- however, the destructor will still call `function(original object)`.) Fix bugs in `lua_setfieldv()`, `lua_rawgetfield()` and `lua_rawsetfield()`. Add C++ functions `lua_destroyuserdata()` to explicitly destroy a `lua_emplace<T>()` userdata object, plus `lua_destroybounduserdata()`. The latter can bind such a userdata object as an upvalue to pass to `LL.atexit()`. Make `LL.help()` and `LL.leaphelp()` help text include the `LL.` prefix.
2024-08-28Remove obsolete, unreferenced DESTRINGIZE(), DEWSTRINGIZE() macros.Nat Goodspeed
2024-08-28Merge pull request #2416 from secondlife/lua-lazymodnat-goodspeed
Allow UI to have lazily-loaded submodules.
2024-08-27Merge pull request #2384 from secondlife/lua-inventoryMaxim Nikolenko
Lua inventory api
2024-08-27code clean upMnikolenko Productengine
2024-08-27Merge branch 'release/luau-scripting' into lua-inventoryMaxim Nikolenko
2024-08-26Merge pull request #2400 from secondlife/lua-issue-2385Maxim Nikolenko
Fix for #2385: say, shout and whisper messages from the script should be displayed consistently
2024-08-26clean up Lua prefixMnikolenko Productengine
2024-08-24Update test scripts to reference UI.Floater, not standalone Floater.Nat Goodspeed
2024-08-23Massage results from UI.popup() for ease of use.Nat Goodspeed
In particular, where the raw leap.request().response call would return {OK_okcancelbuttons=true}, just return the string 'OK' or 'Cancel'. Update existing consumer scripts.
2024-08-23Encapsulate the lazy submodule idiom as util.submoduledir().Nat Goodspeed
2024-08-23Look for lazy UI submodules in a require/UI subdirectory.Nat Goodspeed
This way encourages "UI = require 'UI'; UI.Floater" instead of just "Floater = require 'Floater'". Moreover, now we don't need UI to maintain a list of allowed submodules; that's effected by membership in the subdirectory.
2024-08-23Allow UI to have lazily-loaded submodules.Nat Goodspeed
Equip UI with an __index metamethod. When someone references an unknown key/field in UI, require() that module and cache it for future reference. Add util.setmetamethods() as a way to find or create a metatable on a specified table containing specified metamethods. Exercise the new functionality by referencing UI.popup in test_popup.lua.
2024-08-22Fix for #2385: say, shout and whisper messages from the script should be ↵Mnikolenko Productengine
displayed consistently
2024-08-21mac build fixMnikolenko Productengine
2024-08-21Merge branch 'release/luau-scripting' into lua-inventoryMaxim Nikolenko
2024-08-21Add item limit for collectDescendentsIf func; add demo scriptMnikolenko Productengine
2024-08-21Merge pull request #2373 from secondlife/viewer-lua-2237nat-goodspeed
Fix for #2237: intermittent Lua data stack overflow.
2024-08-21Improve diagnostic output for Lua atexit() functions.Nat Goodspeed
2024-08-21Suppress ~LuaStackDelta() verification during stack unwinding.Nat Goodspeed
Otherwise, an exception raised in the block containing a LuaStackDelta instance -- that might be caught -- would result in an LL_ERRS() crash. We can't expect a block exited via exception to keep its contract wrt the Lua data stack.
2024-08-20Fix a couple more set_interrupts_counter() calls.Nat Goodspeed
2024-08-20Defend timers.Timer(iterate=True) against long callbacks.Nat Goodspeed
Specifically, defend against a callback that runs so long it suspends at a point after the next timer tick.
2024-08-20Fix for #2237: intermittent Lua data stack overflow.Nat Goodspeed
Use a static unordered_map to allow a function receiving (lua_State* L) to look up the LuaState instance managing that lua_State. We've thought about this from time to time already. LuaState's constructor creates the map entry; its destructor removes it; the new static getParent(lua_State* L) method performs the lookup. Migrate lluau::set_interrupts_counter() and check_interrupts_counter() into LuaState member functions. Add a new mInterrupts counter for them. Importantly, LuaState::check_interrupts_counter(), which is indirectly called by a lua_callbacks().interrupt function, no longer performs any Lua stack operations. Empirically, it seems the Lua engine is capable of interrupting itself at a moment when re-entry confuses it. Change previous lluau::set_interrupts_counter(L, 0) calls to LuaState::getParent(L).set_interrupts_counter(0). Also add LuaStackDelta class, and a lua_checkdelta() helper macro, to verify that the Lua data stack depth on exit from a block differs from the depth on entry by exactly the expected amount. Sprinkle lua_checkdelta() macros in likely places.
2024-08-20Fix TempSet to use type VAR to store mOldValue.Nat Goodspeed
In fact we set mOldValue from mVar, and restore mVar from mOldValue, so the VAR type makes the most sense. The previous way, you'd get actual errors if you tried to use TempSet(pointervar, nullptr): that declared mOldValue to be nullptr_t, which you can't initialize from mVar.
2024-08-20Add LL::scope_exitNat Goodspeed
2024-08-20Add collectDescendentsIf api for LuaMnikolenko Productengine
2024-08-15First batch of Inventory api; raise interrupts limitMnikolenko Productengine
2024-08-15Merge branch 'release/luau-scripting' into viewer-lua-2237Nat Goodspeed
2024-08-15Introduce lluau_checkstack(L, n); use instead of luaL_checkstack().Nat Goodspeed
luaL_checkstack() accepts a third parameter which is included in the stack overflow error message. We've been passing nullptr, leading to messages of the form "stack overflow ((null))". lluau_checkstack() implicitly passes __FUNCTION__, so we can distinguish which underlying luaL_checkstack() call encountered the stack overflow condition. Also, when calling each atexit() function, pass Luau's debug.traceback() function as the lua_pcall() error handler. This should help diagnose errors in atexit() functions.
2024-08-13Merge pull request #2274 from secondlife/luau-0.638nat-goodspeed
Update Luau to v0.638-r2 (2024-08-12 build)
2024-08-13Update Luau to v0.638-r2 (2024-08-12 build)Nat Goodspeed
2024-08-13Merge pull request #2240 from secondlife/lua-groupchatMaxim Nikolenko
Lua api for sending group messages
2024-08-13clean up and add commentMnikolenko Productengine
2024-08-13Merge pull request #2265 from secondlife/lua-groupchat-throttleMaxim Nikolenko
Add Throttle and LogThrottle classes to manage throttled APIs.
2024-08-12Add virtual destructor to Throttle class.Nat Goodspeed
2024-08-12Add Throttle and LogThrottle classes to manage throttled APIs.Nat Goodspeed
2024-08-12Merge branch 'release/luau-scripting' into lua-groupchatMaxim Nikolenko
2024-08-12Merge pull request #2209 from secondlife/viewer-lua-smoothernat-goodspeed
Introduce a custom coroutine/fiber scheduler to prioritize UI. With approval from Maxim and Atlas, merging to project trunk.
2024-08-09add demo script for sending group chat messagesMnikolenko Productengine
2024-08-09Lua api for sending group messagesMnikolenko Productengine
2024-08-08Ensure that the flycam stays near moving avatar.Nat Goodspeed
2024-08-07Move #include "coro_scheduler.h" from llstartup to llappviewer.Nat Goodspeed
2024-08-07Allow smaller minimum timer intervals.Nat Goodspeed
Add test_flycam.lua to exercise the smaller intervals.
2024-08-07Move llcoro::scheduler::use() call from llstartup to llappviewer.Nat Goodspeed
Thanks, Maxim.
2024-08-07Merge branch 'release/luau-scripting' into viewer-lua-smootherNat Goodspeed
2024-08-07Merge pull request #2223 from secondlife/lua-login-fixnat-goodspeed
Fix omission in login.savedLogins().
2024-08-07Fix omission in login.savedLogins().Nat Goodspeed
Also add Region.lua.
2024-08-07Merge branch 'release/luau-scripting' into viewer-lua-smootherNat Goodspeed