Releases: tgstation/auxlua
1.1.0
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
, andlist: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 thelen
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
, orworld.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
anddm.state_id
are now registry values, but are still accessible through thedm
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 insleep
, which now no longer has any need for it.
1.0.0
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 callto_table()
when iterating.
0.2.1
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 theprint
function. Failing that, it will callworld.Error
with the error message. This should now make it possible to unshadow_G
if it was previously shadowed.
0.2.0
Fixed
- Fixes a crash that occured when calling
print
when there is more than 1 lua state.
0.1.5
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 atauxtools_panic_[UNIX_TIMESTAMP].log
.
0.1.4
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
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 theprint
function.
0.1.2
[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
[0.1.1]
Changed
- The CPU limit exhaustion error now correctly specifies
sleep
instead ofdm.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
First Full Release Version