turt2live / matrix-appservice-minecraft

A Matrix <--> Minecraft bridge
GNU General Public License v3.0
1 stars 0 forks source link

Handle colored/invalid player names #20

Open turt2live opened 7 years ago

turt2live commented 7 years ago

Offline mode servers, servers without the plugin (when that is created), and scoreboards can all create issues where the player doesn't have a UUID. The bridge should instead create fake player names based on what it sees.

Example: <[VIP] turt2live> Hello Everyone! ends up with a player name of [VIP] turt2live. This player doesn't exist, so we should instead have the following characteristics:

Before defaulting to the generated profile, we should try and strip color codes from the player's name and see if that gives us anything. This will at least work on vanilla servers where the scoreboard is the only colored part of the chat message.

Note that this might not correlate to the player list, which is fine. The online players and joined players may not match. Recommended fix is to get the plugin (when available).