Allow pre-1.13 connections with modern forwarding #1700
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.
I found this slight redundancy while backporting modern forwarding to Forge 1.7.10-1.12.2, and have verified that Velocity rejects player connections if the backend server has not implemented the necessary player info forwarding flow (as it would with any modern server that doesn't have modern forwarding configured correctly).
The statement in the comment:
No longer seems to be true, considering Velocity's
LoginSessionHandlerwill disconnect the player with the messagevelocity.error.modern-forwarding-failedif the proxy doesn't receive thevelocity:player_infoLoginPluginMessagePacket.The
velocity.error.modern-forwarding-needs-new-clientdisconnect message is also somewhat misleading, as it's on the backend server software to support modern forwarding/have modern forwarding configured correctly.To elaborate: if you're using ViaBackwards on a newer backend server you can connect with an older client and could still technically use modern forwarding without any issues client-side, since the
LoginPluginMessagePacketandLoginPluginResponsePacketpackets are only ever exchanged between Velocity and the backend server.Long story short, this bit of code isn't necessary to enforce the modern forwarding spec.
This also somewhat opens the door to those who want to backport modern forwarding, excluding packet registration. I personally haven't thought of a nice way to handle that yet (since it doesn't abide by the Vanilla MC spec), so for the time being I may just create a proxy plugin that injects into the
StateRegistry.