Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server-id hash to LoginEvent #1027

Open
wants to merge 1 commit into
base: dev/3.0.0
Choose a base branch
from

Conversation

RoccoDev
Copy link
Contributor

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:

  • Storing the hash in ConnectedPlayer, however this would bloat the Player API with something that's only relevant during login. Additionally, Mojang starts rejecting the same hash after a while.
  • Creating a different event, like 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant