Commit Graph

12 Commits

Author SHA1 Message Date
SkyratBot
9927170b49 [MIRROR] Auxtools is now a config opt-in [MDB IGNORE] (#20361)
* Auxtools is now a config opt-in (#74501)

See https://github.com/tgstation/tgstation/pull/74497

Causes auxtools to not be a default part of the server environment and
requires server operators to manually enable it.

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Auxtools is now a config opt-in

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
2023-04-06 02:08:19 +01:00
SkyratBot
de42e89ffc [MIRROR] bumps auxlua to 1.4.0 [MDB IGNORE] (#18255)
* bumps auxlua to 1.4.0 (#72108)

## About The Pull Request

Mothblocks recently talked about wanting an auxlua function to check if
the lua state was about to overrun its execution limit, and that was
something I had been thinking about for a long time prior, but never
bothered to actually implement until it was brought up. So I did just
that. The documentation has also been updated to include a description
of how the execution limit works and how to use the new function,
`over_exec_time`

## Why It's Good For The Game

Allows for lua loops of indeterminate length to do as much work as they
reasonably can in a single tick without setting off the execution
limiter and erroring out.

## Changelog

🆑
admin: Adds a new function for admin lua scripting, "over_exec_time",
for checking if lua code is running close to the execution limit.
Details are available in the lua editor's help menu.
admin: The execution limit is described in detail in the lua editor's
help menu.
/🆑

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* bumps auxlua to 1.4.0

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
2022-12-24 21:56:08 -08:00
Zonespace
f7c26bbf25 515 Compat (#17465)
* ONLY SKYRAT CHANGES

* ACTUALLY SKYRAT CHANGES

* yolo, revert later

* Update alternate_byond_versions.txt

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
2022-11-15 06:59:06 +00:00
SkyratBot
375fea374a [MIRROR] Optimizes qdel related things (slight init time savings) [MDB IGNORE] (#17240)
* Optimizes qdel related things (slight init time savings)

* lang holder

* cleanup custom spawners slightly

* ref update

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
2022-10-30 23:15:38 -04:00
SkyratBot
1e7569e0b6 [MIRROR] Fixes hard-dels related to lua signal handlers [MDB IGNORE] (#15965)
* Fixes hard-dels related to lua signal handlers (#69555)

When I changed the syntax of SS13.lua to account for the ability to properly index tables with datums, it turns out that the callbacks created for signal handlers and timeouts had circular references, resulting in hard-deletes.

My first solution was to make it so signal handler and timeout callbacks use weakrefs, which get resolved in lua_state/call_function, but it turns out that, when calling the signal cleanup function, a qdeleted-but-not-yet-garbage-collected datum's weakref resolves to null because datum.gc_collected is set to GC_CURRENTLY_BEING_QDELETED before COMSIG_PARENT_QDELETING gets sent.

To resolve this issue, Potato and Oranges both recommended that I make a snowflake variant of resolve which ignores whether the datum a weakref points to is qdeleted - only that it is null or it's weakref isn't the very weakref resolve was called on. This proc was given a lengthy autodoc comment describing when it should or shouldn't be used, to ensure it is only used in cases similar to the one I needed to create it for (needing to resolve a weakref to a datum in a COMSIG_PARENT_QDELETING handler registered on that very datum).

* Fixes hard-dels related to lua signal handlers

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
2022-09-04 13:58:36 +01:00
SkyratBot
9c33d03245 [MIRROR] [Lua] You can now await expensive non-sleeping procs. [MDB IGNORE] (#15962)
* [Lua] You can now `await` expensive non-sleeping procs. (#69570)

When trying to run getFlatIcon using lua scripting, I discovered that it was so expensive that, for certain atoms like complex humans, there is no way it will complete within the lua execution limit. While Mothblocks would suggest just raising the execution limit, the idea leaves a bad taste in my mouth due to the possibility of a script causing extreme lag by consistently overrunning the BYOND tick.

I instead elected to make /datum/auxtools_promise sleep once before invoking its assigned proc, thus immediately returning execution to lua, even if the proc being awaited wouldn't sleep. This allows for awaiting extremely expensive non-sleeping procs (like the aforementioned getFlatIcon)

* [Lua] You can now `await` expensive non-sleeping procs.

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
2022-09-02 19:49:54 -04:00
SkyratBot
8790837555 [MIRROR] Bumps auxlua to 1.2.1 (+ several other ui fixes and qol tweaks) [MDB IGNORE] (#15786) 2022-08-26 15:48:00 -07:00
SkyratBot
c13c4b0056 [MIRROR] Lua UI improvements [MDB IGNORE] (#15561)
* Lua UI improvements (#68887)

Atomized from #68816, with a little addition. Fixes some dumb formatting issues with the lua editor, adds a "jump to bottom" button when viewing the state log, and paginates the state logs.

* Lua UI improvements

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
2022-08-12 14:27:00 -04:00
GoldenAlpharex
59c5a3c059 [MIRROR] Bump auxlua to 1.0.0 (#68729) (#15488)
Bump auxlua to 1.0.0 (#68729)

* Bump auxlua to 1.0.0

* This should be automated at some point, but meh

* Fix caps diff

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-08-09 03:37:27 +00:00
SkyratBot
6503f2c596 [MIRROR] Fixes a lua state null return related to the print wrapper, improves the lua editor ui formatting, and implements a stopgap lua lag fix [MDB IGNORE] (#15320)
* Fixes a lua state null return related to the print wrapper, improves the lua editor ui formatting, and implements a stopgap lua lag fix (#68816)

This PR fixes this issue by making sure every proc called in the stack of /proc/wrap_lua_print which could sleep is called using INVOKE_ASYNC, and to prevent such problems in the future, marks all the wrappers as SHOULD_NOT_SLEEP(TRUE). I also figured out how to fix the dumb overflowing problem of the lua editor ui.

Due to lag concerns regarding lua states with a large number of global variables (including fields within global tables), I have made it so the global table and state log are hidden by default - they can be shown using a toggle button in the editor ui.

* Fixes a lua state null return related to the print wrapper, improves the lua editor ui formatting, and implements a stopgap lua lag fix

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
2022-07-31 08:43:52 -07:00
Zonespace
a1aee41c68 Ports upstream LUA PRs (#15200)
* 1

* Launch Dreamseeker is the default vscode launch config once again (#68666)

Co-authored-by: William Wallace <me@wiox.me>
2022-07-27 15:14:22 -07:00
Zonespace
15a223ff2d [MIRROR] Admin lua scripting (#65635) (#15118)
[Ready for Review] Admin lua scripting (#65635)

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-07-24 19:55:53 +01:00