game: send the client brand once per connection, as the vanilla client does - #4082
Open
u9g wants to merge 1 commit into
Open
game: send the client brand once per connection, as the vanilla client does#4082u9g wants to merge 1 commit into
u9g wants to merge 1 commit into
Conversation
Contributor
|
Tests more than 1.5x slower than master (durations are noisy, so this is informational): |
Member
Author
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.
On 1.20.2+ the client brand goes out twice.
node-minecraft-protocol already sends it correctly, on the first entry into the configuration state, which is where the vanilla client sends it (
ClientHandshakePacketListenerImpl:login_acknowledged→BrandPayload→ClientInformation).game.jsthen writes it again on everyloginpacket, so a fresh connection sends two, and every Velocity backend transfer — which re-enters configuration and sends a secondlogin— sends another. Vanilla sends none of those:BrandPayloadappears only in the handshake listener, never inClientPacketListener, and re-entering configuration from play sends nothing.Before the configuration state existed the client did send the brand on joining the world (1.19.4
ClientPacketListener.handleLogin), so the write stays for those versions — the same shapesettings.jsalready uses for Client Information:Measured against a live 26.1 server (JartexNetwork, Velocity), tracing every outgoing packet from before the socket opened.
Fresh connection, before:
After: the
[play]one is gone, one brand total.Backend transfer, before:
< start_configuration … < loginthen> custom_payload [play] vanilla. After: no brand at all, and the transfer still completes.npm run mocha_test: 763 passing / 73 pending / 4 failing, and unmodified master at the same commit gives 763 / 73 / 4 as well — the failures are the pre-existing flakyworld switchWorld respawn, which times out on a different random subset of pre-1.20.2 versions on each run (mine: 1.10.2, 1.11.2, 1.18.2, 1.19.3; master's: 1.14.4, 1.15.2, 1.16.5, 1.19.2). Those are all versions where this change is a no-op.