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.
This adds the
serverId
hash (that was sent to Mojang during authentication) to a login event for plugins to use.The reason for this is that while
prevent-client-proxy-connections
is currently working (previously, a Mojang bug prevented it from working), there is no way to distinguish a proxy block from a regular offline-mode user.Based on production experience, the proxy block system might prevent legitimate players from joining, especially those in
countries that employ network filtering.
This solution acts as a workaround to allow plugins to manually check for proxies (by sending more
hasJoined
requests to Mojang), by giving them access to the server ID hash that was generated during authentication.There are definitely more ways to expose this information, such as:
ConnectedPlayer
, however this would bloat thePlayer
API with something that's only relevant during login. Additionally, Mojang starts rejecting the same hash after a while.AuthenticationEvent
, dedicated to auth data like the server ID hash.I think
LoginEvent
is currently the best compromise to store this data without introducing a new event, let me know what you think.