CloudburstMC / Protocol

A protocol library for Minecraft Bedrock Edition
https://git.io/ProtocolLib
Apache License 2.0
310 stars 96 forks source link

Update SubClientLoginSerializer_v291.java #215

Closed terryherbert closed 6 months ago

terryherbert commented 6 months ago

After investigating why Spilt Screen functionality was not functioning on GeyserMC, I discovered that the SubClientLogin message received from the Bedrock client could not be deserialize by SubClientLoginSerializer_v291.

The original code expected a JSONArray off the wire, however we were actually getting a JSONObject containing JSONArray when you get "chain".

Further investigation I discovered that this mirrors precisely what the LoginSerializer_v291, the only exception is that SubClientLogin message does not start with the protocol version.

I have updated the serialize method to mirror that of deserialize.

With these changes plus a some additional in GeyserMC works.