ticalc-usb icon indicating copy to clipboard operation
ticalc-usb copied to clipboard

Add device.getDirectory

Open commandblockguy opened this issue 2 years ago • 11 comments

Adds a method to get the list of variables on a device.

This PR also adds support for receiving fragmented virtual packets and an expectAny method for receiving a virtual packet of unknown type.

It also makes several changes to parameter handling:

  • Adds a public function for getting parameters from the device
  • Allows non-numerical parameters to be constructed and destructed
  • Fixes a bug in which an unrecognized parameter caused parsing to fail, as the code always expected a size to be provided, despite this not being the case when the device doesn't return a value for the parameter.
  • Fixed a test case which relied on this bug
  • Changed the return type of destructParameters to be an object rather than an array and to only include valid parameters
  • Updated the test cases to use the new return format

I've only tested this on the CE, so it will probably need additional testing before being merged.

commandblockguy avatar Sep 14 '21 23:09 commandblockguy