mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-18 08:25:27 +01:00
Use PlayerLoginEvent instead to alleviate ban concerns
Research indicates that there is still enough time from login to join for this to be a good idea.
This commit is contained in:
parent
f1f9ffc10b
commit
ffd11f6e0e
@ -270,22 +270,12 @@ public class PlayerListener implements Listener {
|
|||||||
* Start user data prefetch.
|
* Start user data prefetch.
|
||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onFirstLogin(AsyncPlayerPreLoginEvent event) {
|
public void onLoginStart(PlayerLoginEvent event) {
|
||||||
UserManager.prefetchUserData(event.getName());
|
UserManager.prefetchUserData(event.getPlayer().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel user data prefetch if another plugin kicks them.
|
* Cancel user data prefetch if a plugin kicks them.
|
||||||
*/
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
|
||||||
public void onPreLoginComplete(AsyncPlayerPreLoginEvent event) {
|
|
||||||
if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
|
|
||||||
UserManager.discardPrefetch(event.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancel user data prefetch if they're banned or a plugin kicks them.
|
|
||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
||||||
public void onLoginComplete(PlayerLoginEvent event) {
|
public void onLoginComplete(PlayerLoginEvent event) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user