Paper icon indicating copy to clipboard operation
Paper copied to clipboard

RGB colors in MOTD not supported when player is kicked

Open takatalvi opened this issue 3 years ago • 1 comments

Expected behavior

Paper supports RGB color codes in the MOTD that is displayed in the client's server list. This is an extension on vanilla servers which don't support RGB in MOTD at all. The MOTD should behave consistently and keep the defined colors regardless of how a player disconnects.

Observed/Actual behavior

When a player is kicked from the server, the server's MOTD falls back to vanilla colors which messes up the RGB codes in the MOTD definition. Refreshing the server list fixes the colors per Paper's RGB support. When a player disconnects from the server voluntarily, the RGB colors are also respected. It points to the fact that when a player is kicked by the server, a packet is sent which updates the MOTD but the method for displaying colors here is different from the usual one which Paper uses.

Steps/models to reproduce

  1. Connect to a 1.19 server which uses RGB codes in MOTD
  2. Disconnect
  3. The RGB colors in the MOTD are OK
  4. Connect again
  5. Get kicked by the server
  6. The MOTD's colors are broken
  7. Refresh the server list
  8. The RGB colors in the MOTD are OK

Plugin and Datapack List

Plugins (28): ChatBubbles, Chunky, CoreProtect, DecentHolograms, dynmap, Essentials, EssentialsChat, EssentialsDiscord, EssentialsGeoIP, EssentialsProtect, EssentialsSpawn, floodgate, Geyser-Spigot, GSit, LuckPerms, LWC, Multiverse-Core, Multiverse-Inventories, Multiverse-NetherPortals, OpenInv, QuickChannels, Simple-Playerlist, SkQuery, Skript, Vault, WorldEdit, WorldEditSUI, WorldGuard

There are 3 data packs enabled: [vanilla (built-in)], [file/bukkit (world)], [file/kamienok (world)] There are no more data packs available

(Custom datapack only for custom recipes)

Paper version

[14:59:13 INFO]: This server is running Paper version git-Paper-40 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT) (Git: 0d79b86) You are running the latest version Previous version: git-Paper-34 (MC: 1.19)

Other

A recent issue was fixed by changing how MOTD is parsed. Maybe this could also be implemented in the new way servers send packets after kicking.

Vanilla 1.19 introduced something related (taken from the release announcement changelog):

Servers will now also send an additional icon and MOTD packet after a player has connected This allows servers with enable-status=false to set an icon and MOTD for players that successfully connect

This might be a longshot but I also found a bug report in Velocity with a similar description, also the new vanilla MOTD behavior is mentioned in the comments.

takatalvi avatar Jun 29 '22 13:06 takatalvi

Can reproduce. This happens because MOTD plugins modify the outcome of the ServerListPingEvent, which is not fired when the status is sent again after the player fully joins. Normally, the server list refreshes when you disconnect, but if you get kicked this doesn't happen, showing the vanilla MOTD.

NoahvdAa avatar Jun 29 '22 14:06 NoahvdAa