BukkitConnectionListener.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:LuckPerms 作者:
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerPreLoginMonitor(AsyncPlayerPreLoginEvent e) {
    /* Listen to see if the event was cancelled after we initially handled the connection
       If the connection was cancelled here, we need to do something to clean up the data that was loaded. */

    // Check to see if this connection was denied at LOW.
    if (this.deniedAsyncLogin.remove(e.getUniqueId())) {
        // their data was never loaded at LOW priority, now check to see if they have been magically allowed since then.

        // This is a problem, as they were denied at low priority, but are now being allowed.
        if (e.getLoginResult() == AsyncPlayerPreLoginEvent.Result.ALLOWED) {
            this.plugin.getLog().severe("Player connection was re-allowed for " + e.getUniqueId());
            e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "");
        }

        return;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号