Immediate disconnection when "host:sendChatCommand()" runs with formatting codes included
Gakuto1112 opened this issue · 2 comments
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
- Turn on "Chat Messages".
- 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.")
Expected behavior
Figura should remove formatting code when running host:sendChatCommand()
or host:sendChatCommand()
to prevent players from disconnecting.
Notes
- This issue occurs even in single player because of Minecraft specifications.
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.