Kingdom-of-The-Moon / FiguraRewriteRewrite

rewrite of the rewrite of figura
GNU Lesser General Public License v2.1
1 stars 1 forks source link

Immediate disconnection when "host:sendChatCommand()" runs with formatting codes included #47

Closed Gakuto1112 closed 1 year ago

Gakuto1112 commented 1 year ago

Description

Players who uses Figura avatar will be disconnected immediately because of "Illigal characters in chat" when avatar script runs host:sendChatCommand() or host:sendChatCommand() with formatting codes included.

How to reproduce

  1. Turn on "Chat Messages".
  2. Run codes like below with avatar script. Note: You cannot run this code with /figura run <code>.
host:sendChatCommand("§cThis text will force you to disconnect.")
  1. You will be kicked by Minecraft server.

    Disconnection screen

Expected behavior

Figura should remove formatting code when running host:sendChatCommand() or host:sendChatCommand() to prevent players from disconnecting.

Notes

GrandpaScout commented 1 year ago

Play stupid games win stupid prizes I guess. This can very easily be avoided in base Lua with a simple

str = str:gsub("§[0-9a-fklmnor]?", "")

Also, I would advise against the suggestion as some servers do allow the use of the section sign in chat messages sent by players.

Francy-chan commented 1 year ago

Not fixing this, as the server can allow the user to input "§" or have changed the blacklisted character to another one