IdentityProviderImpl.java 文件源码

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

项目:ProjectAres 作者:
/**
 * Clear any nickname that collides with the real name of a player logging in.
 * This ensures that usernames + nicknames together contain no duplicates.
 * The user who's nickname was cleared is not notified of this, but this
 * should be an extremely rare situation, so it's not a big problem.
 */
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
public void clearConflictingNicks(AsyncPlayerPreLoginEvent event) {
    final String name = event.getName();
    syncExecutor.execute(() -> {
        final Player player = nicknames.get(name);
        if(player != null) {
            changeIdentity(player, null);
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号