Skip to content

feat(proxy): Added Login/Logout event tracking in the bungeecord/velocity modules#3096

Open
GoodTimes14 wants to merge 5 commits into
AuthMe:masterfrom
GoodTimes14:master
Open

feat(proxy): Added Login/Logout event tracking in the bungeecord/velocity modules#3096
GoodTimes14 wants to merge 5 commits into
AuthMe:masterfrom
GoodTimes14:master

Conversation

@GoodTimes14

Copy link
Copy Markdown

this changes allow other plugin developers to listen for AuthMe logins and logouts on the proxy side, really useful if you want to block certain mechanics that should watch for the current player authentication state.

@sgdc3 sgdc3 requested a review from Xephi June 25, 2026 19:03
@sgdc3

sgdc3 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Looks good to me 👍🏻

Comment on lines +256 to +260
ProxiedPlayer player = proxyServer.getPlayer(playerName);
if (player != null) {
boolean premium = requiresPremiumVerification(parsedMessage.playerName());
proxyServer.getPluginManager().callEvent(new AuthMeBungeeLoginEvent(player, premium));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isPremium() is always false for premium players (non-normalized name passed to premium lookup).
The new code computes boolean premium = requiresPremiumVerification(parsedMessage.playerName()) using the raw player name (e.g. "Alice"), but requiresPremiumVerification checks premiumUsernames / pendingPremiumUsernames, which store lowercase-normalized names (populated via normalizeName(...) at lines 287/306). So for any mixed/upper-case username, the lookup misses and AuthMeBungeeLoginEvent.isPremium() reports false even for genuinely premium players. The normalized playerName variable was just computed three lines above and should be used here (line 249) exactly as the Velocity side does (requiresPremiumVerification(normalizeName(...))).
Btw, the new test uses a non-premium player, so it doesn't catch this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants