Closed JasonTable closed 7 months ago
This can be done using Lua hooks. The example on the wiki for set_hook
shows how to force a coroutine to yield every 8 cycles. But you can also do things like raise an error to stop execution if you are no using coroutines.
This can be done using Lua hooks. The example on the wiki for
set_hook
shows how to force a coroutine to yield ever 8 cycles. But you can also do things like raise an error to stop execution if you are no using coroutines.
I thought you cannot yield from lua hooks?
Nvm.
Nvm.
I am going to close this as complete as there has been no follow up. Feel free to re open if you are still having issues.
Is your feature request related to a problem? Please describe. one of the selling points of this plugin is its sandboxing capabilities. So if i were to use it to run untrusted user created code, one minor exploit they could do is freeze the software with a while true loop. It's a minor nuisance at worst but i would still like to mitigate it if possible.
Describe the solution you'd like Is there a way to limit the execution time of the lua code so this can't happen?