wow-rp-addons / LibMSP

The “Mary Sue Protocol” (“MSP” for short) is a simple challenge/response protocol for RP UI add-ons within WoW to communicate with each other and publish text information to other clients (such as RP character names and descriptions).
Creative Commons Zero v1.0 Universal
2 stars 1 forks source link

Itarater/readable only #14

Closed ghost closed 6 years ago

ghost commented 6 years ago

(Only the last commit is particularly relevant -- "Permit readable characters only" -- I branched this from some code I was working on separately that should be uncontroversial.)

This is untested and relies on a special Chomp branch that will only be merged if we all agree this is a good idea. This is more for discussion than directly pulling the code as-is.

This makes some changes to the LibMSP wire format, and some changes to how fields are handled. The wire format changes to replace = with : in the field responses (HHA983F:Home location instead of HHA983F=Home location), which is an optimization only (= has to be encoded quoted-printable, : does not).

It also makes the more drastic change of swapping out 0x7f for 0x60 (which is a backtick). If the new separator byte is encountered in a profile, it's silently replaced with an apostrophe (') in the hope nobody notices.

Finally, it runs a new Chomp function (from the branch above) that checks whether any content not permitted in logged messages is present, and rejects the field contents if they are with an error. It'd be better for addons to also check and inform the user earlier, so that can be added later. It should be unlikely for anyone will run into this error without doing something improper.

So... You're probably wondering why. Well, I'm panicking with the deadline so close, and I'm concerned that Blizzard might pull the rug out from under us on the two non-readable bytes they're currently allowing (0x09 and 0x7f). The more I learn about the quirks of logged addon messages, the more I'm worried about sending anything that isn't very strictly printable.

I'm also worried about sending quoted-printable encoded data where not explicitly required, since Blizzard also disallows certain Unicode codepoints, such as U+534D and U+5350 (glyphs resembling a symbol used by the most infamous fascist government in recent, if not all, history). They silently fail if these are present, which is the same as happens in normal chat. If we send such things encode as quoted-printable, they're no longer reportable -- if we just ignore them entirely, we get silent failures. I'm also worried that logged addon messages directly use Blizzard's chat filtering system, the one that they seem to add to and remove from as they see fit, based on what sort of chat abuses happen.

There is no way to determined if a message has been sent, so my panicking largely amounts to reducing our exposure, in terms of how many unreadable bytes we send on a regular basis.

If we decide to do this, I will do everything I possibly can to take care of all the necessary changes in all addons before Tuesday, since this is my panicking and my last-minute proposed changes.

Ellypse commented 6 years ago

I have tested these changes (with both the LibMSP and Chomp branches to "logged-readable-only") and confirmed to have no issue in Total RP3, MyRolePlay, and both talking to each other.

Accentuated characters don't raise any issue and the ` character is escaped as '.

I have also confirmed that the changes to Chomp does not impact Total RP 3 when sending complex structured serialized and compressed.