[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Release notes for MUSHclient version 4.06


Version 4.06

Released on 26 Apr 2007

1. Fixed bug in utils.utf8encode where it would not correctly encode the 0x00 byte - because it was used as a string terminator.

2. Rewrote utils.utf8decode so that it correctly handles all UTF-8 code sequences from 0 to 7FFFFFFF. The one in version 4.05 only worked from 1 to FFFF - partly because it used 0x00 as a string terminator, and partly because it used the Windows API call MultiByteToWideChar, which only returns 16-bit wide characters.

Also, utils.utf8decode no longer raises an error on a bad UTF-8 string, but returns nil instead. Thus, a return of nil indicates a bad string, otherwise it returns a table (which might be empty) consisting of one entry for each Unicode code point.

3. Changed utils.utf8valid so that for a valid string it returns the length of it (in Unicode code points) rather than simply true. Thus the two possible returns from utils.utf8valid are:

* number of code points (might be zero) - for a valid UTF-8 string
* nil, column number - for an invalid string (column number starts at 1).

4. Fixed bug in utils.utf8valid where it would terminate on the code 0x00, as it was considered a string terminator. Now it is counted as a valid byte.

5. Function utils.utf8encode now raises an error if an argument has decimal places. For example:

utils.utf8encode (1, 10, 11, 250.5) --> bad argument #4 to 'utf8encode' (Cannot encode numbers with decimal places)

6. Altered trigger edit dialog, and alias edit dialog, to show (near the number of matches) an error message if there was a run-time error evaluating the regular expression.

7. Added new selector 28 to GetAliasInfo - this is the error number of an execution error of the regular expressions. If non-zero then this alias has had a runtime error and is no longer being evaluated.

8. Added new selector 35 to GetTriggerInfo - this is the error number of an execution error of the regular expressions. If non-zero then this trigger has had a runtime error and is no longer being evaluated.

9. If the world is using UTF-8 encoding (see Output configuration), each line is checked for valid UTF-8 before being passed to trigger processing. If it fails this check, then the triggers are not evaluated (as they would all fail with "bad UTF8" message). Also a count is incremented, which can be tested with GetInfo (242).

The reason for this is to stop a "denial of service" attack, where a player might deliberately say something with bad UTF-8 in it, thus causing all triggers to fail at the client end.

This might also happen if a player turned UTF-8 on, for a MUD that doesn't support it, and then any character with a code >= 128 potentially could cause bad UTF-8 to be shown.

Also, for every 128 lines which have this error, a message is displayed in the output window to alert you to this problem.


10. Added new selector 242 to GetInfo - this is the count of lines that had bad UTF-8 in them, and were not considered for trigger evaluation.


11. Modified utils.utf8encode so that you can also supply a table as any of the arguments to the function. If you supply a table, then all sequential, numerically-keyed items are also added to the UTF-8 string.

eg.

print (utils.tohex (utils.utf8encode ( { 5000, 10000 } ))) --> E18E88E29C90


12. Fixed documentation for os.date function to remove references to the "#" modifier eliminating leading zeroes, which was apparently incorrect.


13. As regular expressions can now have duplicate named wildcards (if you use the (?J) option), the regular expression routines have been reworked a bit to correctly work with duplicate names.

* When receiving a table of wildcards (in a Lua trigger / alias function) the table entry for the name is now the last non-empty name. Previously if a name occurred twice, then it potentially placed the value of the name in the table, and then replaced it by "false".

* If you use the %<name> syntax in "send to script" for triggers or aliases, it now correctly looks up the name. Previously it would only have worked for duplicate names if the match was on the first occurrence.

In both cases, if the name matches multiple times the results are not really defined, and will probably be different in the two cases above.


14. Added the (?U) (ungreedy) and (?J) (duplicate names) flags to the menu that appears when you click on the "->" button when editing a regular expression.


15. Added an option to make triggers and aliases "one-shot". That is, if they are one-shot they delete themselves shortly after firing. This is the "one_shot" flag in the XML code, and you can use 32768 as the flag when doing an AddTrigger or AddAlias.

16. Reworked help files considerably, so that (almost) all Lua functions are in a separate page rather than in one big page (eg. each string function has its own page now).

This makes finding individual standard functions (like string.find) much easier.

17. Added Lua standard functions (plus the MUSHclient extensions) to the auto-complete menu for script entry. For example, if you type "string." into the command window, and press Shift+Tab, all of the Lua string functions are listed for auto completion.

18. Added Lua standard functions (plus the MUSHclient extensions) to the Help -> Functions List dialog, so that help on Lua functions is now readily available.

19. The world.Help function now also accepts Lua function names. For example: Help ("print") shows the help page for the print function.

20. Fixed a bug where if you deleted a temporary trigger, the world would be marked as "changed" whereas, it wasn't really, as temporary triggers are not saved to disk.

View all MUSHclient release notes

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]