client: send particleStatus in the configuration-phase settings packet - #1519
Open
u9g wants to merge 1 commit into
Open
client: send particleStatus in the configuration-phase settings packet#1519u9g wants to merge 1 commit into
u9g wants to merge 1 commit into
Conversation
Since 1.21.3 Client Information carries a particle status (all / decreased /
minimal). The settings written on entering the configuration state left it
out, so the field was serialized from `undefined` — it only came out as 0
("all") because the compiled protodef mapper falls through unmapped values
to the numeric type, where NaN writes as 0. Send it explicitly, defaulting to
'all' and overridable through `clientSettings.particleStatus` like the other
fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 1.21.3 Client Information (
settings) carriesparticleStatus(all/decreased/minimal). The settings packet written on entering the configuration state (src/client/play.js) doesn't set it, so the mapper is serialized fromundefined. It happens to go out as0=alltoday only because protodef's compiled mapper falls an unmapped value through to the numeric type, whereNaNwrites as0— the interpreted mapper throws on the same input.ProtoDef-io/node-protodef is about to make the compiled mapper strict too (throw on a value not in the mappings, matching the interpreter), which turns this into a serialization error on every 1.21.3+ login. Send the field explicitly, default
'all', overridable viaclientSettings.particleStatuslike the other fields. Extra container fields are ignored on older versions, so this is safe pre-1.21.3.Found while tracking down a Velocity "An internal error occurred in your connection" kick: a play-state packet written during a server transfer's configuration phase went out as a bare
0x00byte for the same reason.