Skip to content

fix(codec): serialize persona tints and skin colours like BDS since v2168 - #290

Open
Miroshka000 wants to merge 1 commit into
AllayMC:mainfrom
Miroshka000:pr/skin-serialization
Open

Miroshka000 wants to merge 1 commit into
AllayMC:mainfrom
Miroshka000:pr/skin-serialization

Conversation

@Miroshka000

Copy link
Copy Markdown

Summary

Since v2168 a skin in PlayerListPacket carries its persona tint colours and skin colour. Two fields were written differently from BDS, and a 1.26.50 - 1.26.52 client refuses the player list entry (InitialConnection error on join) when they do not match:

  • Tint type: clients send the persona_ form of a piece type in their login data (for example persona_mouth), but BDS writes the canonical name (mouth). The serializer now writes PersonaPieceType.fromName(type).getSerializeName().
  • Skin colour: clients send #RRGGBB, which was parsed with alpha 0, so the colour was written as transparent. SerializedSkin now reads #RRGGBB as opaque and keeps the alpha of #AARRGGBB (#0 stays transparent), and the serializer writes Color#getRGB().

The change is in BedrockCodecHelper_v2168 and in BedrockCodecHelper_v2225, which writes the same fields.

How it was checked

  • BedrockCodecHelper_v2168SkinTest covers both fields.
  • ./gradlew :bedrock-codec:test passes (44 tests).
  • A 1.26.52 Windows client joins an Allay server built against this branch; before the change it failed to join. The values match a BDS 1.26.52 player list captured for comparison.

…2168

Clients send persona tint types as "persona_mouth" and the skin colour as
"#RRGGBB" in their login data. v2168+ wrote the tint type verbatim and the
colour with a zero alpha, while BDS writes the canonical name ("mouth") and
an opaque colour; 1.26.52 clients drop the session on such a player list
entry for themselves.

Write the canonical tint name, parse "#RRGGBB" colours as opaque in one
place and write the skin colour from its ARGB value.
@Miroshka000

Copy link
Copy Markdown
Author

Closing for now: daoge_cmd has added Bedrock 1.26.45 and 1.26.50 support to Allay himself (AllayMC/Allay@ac391e41f). I'll wait for his feedback on how he wants the rest of the 1.26.50 work and reopen if it is still needed.

@Miroshka000

Copy link
Copy Markdown
Author

Reopening: on current Allay master (with ac391e41f) a 1.26.52 Windows client still fails to join with InitialConnection-148. With this fix and AllayMC/Allay#1855 - #1861 it joins and plays. The player list part on the Allay side is AllayMC/Allay#1856.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant