Enforce encryption chat length clientside
Madis0 opened this issue ยท 1 comments
Idea
Because encrypted messages do increase the length of the message, it should also limit the new character count the player can send in the first place to avoid getting part of the message cut. This should apply only to cases that have the limits in the first place, aka public chats or private messages, depending on which ones are enabled.
I guess the easiest (not necessarily fastest) way to do that would be to:
- detect whether the player is typing an encryptable message
- encrypt the message on every character change
- see if encrypted message <= 256
Alternatively, continue encrypting on send and show some kind of error when sending a too long message.
Reasoning
Because then the player knows how much they can really type, instead of getting a part of the message cut.
Other Information
P.S. Don't rely on any chat preview code for this, as that is getting removed in 1.19.3 lol