feat(proxy): Added Login/Logout event tracking in the bungeecord/velocity modules#3096
feat(proxy): Added Login/Logout event tracking in the bungeecord/velocity modules#3096GoodTimes14 wants to merge 5 commits into
Conversation
|
Looks good to me 👍🏻 |
| ProxiedPlayer player = proxyServer.getPlayer(playerName); | ||
| if (player != null) { | ||
| boolean premium = requiresPremiumVerification(parsedMessage.playerName()); | ||
| proxyServer.getPluginManager().callEvent(new AuthMeBungeeLoginEvent(player, premium)); | ||
| } |
There was a problem hiding this comment.
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.
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.