aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets/handlers/handleMS.ts
AgeCommit message (Collapse)Author
5 daysFix offset token substitution in MS packetOsmium Sorcerer
In an IC message, x and y offsets are separated by an ampersand, which is unfortunately a conventional separator within packet fields. So, it looks like `25&10` for x = 25 and y = 10. A consequence of that is you have to substitute '&' if you actually want to send it. AO does it by substituting it to `<and>` and back. The MS handler instead expected it to never be decoded, and instead assumed `25<and>10`. By the time the MS packet reaches the handler, the token has already been decoded into '&', however, thus breaking offsets.
5 daysRemove toLowerCase manglingOsmium Sorcerer
For whatever reason, WebAO decides to normalize almost every string component in URLs, packets, and INI files to lower case. First, the glaring issue. In the URLs, this handling of paths is utterly broken and corrupts data. By mangling characters, you change the resource identity and break valid URLs. According to section 6.2.2.1 of RFC 3986 (Case Normalization): > When a URI uses components of the generic syntax, the component syntax > equivalence rules always apply; namely, that the scheme and host are > case-insensitive and therefore should be normalized to lowercase. For > example, the URI <HTTP://www.EXAMPLE.com/> is equivalent to > <http://www.example.com/>. The other generic syntax components are > assumed to be case-sensitive unless specifically defined otherwise by > the scheme (see Section 6.2.3) Scheme and host _are_ case-insensitive. Path is _not_, so isn't everything else. Section 6.2.3 doesn't define any normalization for the path component in HTTP schemes. Thus, example.com/item and example.com/Item are two different resources. I can only think of idiotic conventions of a particular poorly designed file system when it comes to this absurdity. There's no reason to drag them around in our developments. For these systems, case doesn't matter anyway, normalization is their job, not server hosts' who end up having to either rewrite every URL request for every asset, or mangle their asset directory and then rewrite almost every INI config (and spam "showname=Name" everywhere because now your character directory has to be "name"). So, instead of using absurd ad-hoc solutions to a broken implementation such as forcing everything to lower case on the server side, this commit attempts to fix the root issue and make URL handling conformant to relevant standards. Similar situation with strings within packets, although not as severe in practice. Case must be preserved, otherwise it's corrupting data for no reason. If a normalization is needed, it should be done at the call site of whatever requires it (like a filtering function), not by the parser. As for the INI, it's opinionated. While the values absolutely must not be normalized, a case can be made for keys and section names: why not allow "Options", "options", or even "oPtiOnS"? It's more convenient, and corresponds to the platform quirk of Windows (which Qt unfortunately inherits in AO2 Client). I don't think there's a good reason to allow such leniency in parsing, and removing superfluous normalization is a better move: less data transformations, less ambiguity, more strictness. In practice, INIs tend to be well-formed, and it's good discipline to write them this way. In several places, the case-folding does make sense: callwords, OOC commands, CSS class names for areas, and character list filters. These will behave weirdly and inconveniently without it. In most places, however, it only causes unnecessary breakage.
2026-02-07Defer char.ini loading and use direct img src for char iconsDavid Skoland
Instead of eagerly fetching char_icon (with HEAD requests per extension) and char.ini for every character on join, set img.src directly to char_icon.png and defer char.ini loading until actually needed (character selection via handlePV, or first IC message via handleMS). This eliminates thousands of HTTP requests on join for large character lists. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2025-06-22off by onestonedDiscord
fix #263
2024-11-20Prettified Code!stonedDiscord
2024-09-29HandleMS should only be in charge of parsing chat message.Caleb Mabry
2023-11-23Hide chatbox on blankpostsDavid Skoland
2023-11-23FormattingDavid Skoland
2023-09-20autoformat with eslintstonedDiscord
2023-04-10more robust argsstonedDiscord
2023-01-23detect blankpoststonedDiscord
2023-01-08do showname encoding differentstonedDiscord
2022-09-11Refactor getChatmsgCaleb
2022-09-11Typechecking changedCaleb
2022-09-09Migrated functionsCaleb
2022-08-25Removing unused importsCaleb
2022-08-25Remove handleMS and separate queryParserCaleb