Skip to content

Releases: tgstation/auxlua

1.1.0

16 Aug 02:34
Compare
Choose a tag to compare

Added

  • Adds support for directly accessing and modifying the following types of lists:

  • args

  • vis_contents

  • vis_locs

  • world.contents

  • image overlays

  • image underlays

  • Adds an is_null method for all DM userdata types, which returns the truthiness of the DM value passed into it.

  • Datum vars and list keys can now be get and set using the __index and __newindex metamethods. datum:get_var, datum:set_var, list:get, and list:set are kept as legacy functions, but the existing methods for datums and lists will shadow datum vars and assoc list keys with the same name. You are still able to get and set otherwise shadowed variables using the mentions mentioned prior.

  • The length of DM lists can now be obtained using the __len metamethod. list.len is kept as a legacy field, but will shadow the len key of assoc lists that have one.

Fixed

  • Converting a recursive table to/from lua no longer causes a stack overflow.

Changed

  • You can no longer directly pass the following types of lists to lua functions from DM, as they are attached to datums, and as such, are not guaranteed to remain valid for the entire time they are referenced in lua (this restriction does not apply to global.vars, world.vars, or world.contents, as they will always be valid):

  • vars

  • overlays

  • underlays

  • vis_contents

  • vis_locs

  • contents

  • The sleep queue, yield table, and task info table are now registry values, as there is no need for users to access them from lua code. If you need the first empty index in the yield table, you can access it with the global field __next_yield_index.

  • dm.usr and dm.state_id are now registry values, but are still accessible through the dm table using its __index metamethod.

  • sleep is now a native function.

  • Internally, DM userdata is now cached in a manner that results in userdata instances corresponding to the same underlying DM value being strictly equal. This is important because table indexing only tests by strict equality. As a result of this change, you can now properly index tables with datums and list references.

Removed

  • Removed the __set_sleep_flag() function, as it was only intended for use in sleep, which now no longer has any need for it.

1.0.0

25 Jul 10:15
Compare
Choose a tag to compare

Added

  • Added of_type method to DM lists, which filters by typepath. For instance, mob_list:of_type("/mob/living/carbon/human").
  • Added an __iter metamethod to DM lists, meaning you no longer need to call to_table() when iterating.

0.2.1

24 Jul 04:21
Compare
Choose a tag to compare

Changed

  • Error logging for auxlua's internal mechanisms should be much more verbose.
  • Instead of runtiming when failing to set dm.usr, auxlua will first attempt to print the error using the print function. Failing that, it will call world.Error with the error message. This should now make it possible to unshadow _G if it was previously shadowed.

0.2.0

21 Jul 23:44
Compare
Choose a tag to compare

Fixed

  • Fixes a crash that occured when calling print when there is more than 1 lua state.

0.1.5

19 Jul 21:21
Compare
Choose a tag to compare

Changed

  • On Windows, the dll file is no longer pinned to the process that loads it - it will be unloaded upon calling auxtools_full_shutdown and subsequently closing the world that initialized it.

Added

  • In the event of a panic, said panic will be output to a log file. If a DM global var of the name log_directory is specified at init-time, the panic log will be located at [log_directory]/auxtools_panic.log. Otherwise, it will be located at auxtools_panic_[UNIX_TIMESTAMP].log.

0.1.4

18 Jul 23:38
Compare
Choose a tag to compare

Fixed

  • Fixed a crash when trying to call a proc on dm.global_vars.
  • Fixed a crash when trying to add a var to a vars-type list.
  • Fixed directly setting a value in a vars-type list being usable to bypass the set-var wrapper.

0.1.3

03 Jul 03:54
Compare
Choose a tag to compare

Added

  • Implements the __tostring metamethod for DM types.
  • Adds the hook __lua_set_print_wrapper, allowing you to set a DM proc as a wrapper for the print function.

0.1.2

28 Jun 01:36
Compare
Choose a tag to compare

[0.1.2]

Changed

  • Instead of failing to convert, Lua values unrepresentable in DM will be converted to strings in a manner consistent with Lua's print function.

Fixed

  • Fixed a crash caused by inappropriate code for calling the datum var setting wrapper.
  • In the event that a lua value somehow fails to convert to a DM value when read by __lua_get_globals, the pointer will actually refer to the value's location in memory rather than the address of the Rust wrapper.

0.1.1

25 Jun 22:13
Compare
Choose a tag to compare

[0.1.1]

Changed

  • The CPU limit exhaustion error now correctly specifies sleep instead of dm.sleep

Fixed

  • Fixed all created states having the same internal ID, leading there to be only one state in practice.
  • Fixed a bug causing states to reach the execution limit before even having a chance to run their code.

0.1.0

15 Jun 20:22
Compare
Choose a tag to compare

First Full Release Version