forked from TuxCoding/FastLogin
Disable restore session cancel
This commit is contained in:
@ -1,15 +1,11 @@
|
|||||||
package com.github.games647.fastlogin.bukkit.hook;
|
package com.github.games647.fastlogin.bukkit.hook;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.events.RestoreSessionEvent;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,17 +25,6 @@ public class AuthMeHook implements AuthPlugin<Player>, Listener {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
|
||||||
public void onSessionRestore(RestoreSessionEvent restoreSessionEvent) {
|
|
||||||
Player player = restoreSessionEvent.getPlayer();
|
|
||||||
|
|
||||||
String id = '/' + player.getAddress().getAddress().getHostAddress() + ':' + player.getAddress().getPort();
|
|
||||||
BukkitLoginSession session = plugin.getLoginSessions().get(id);
|
|
||||||
if (session != null && session.isVerified()) {
|
|
||||||
restoreSessionEvent.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean forceLogin(Player player) {
|
public boolean forceLogin(Player player) {
|
||||||
if (AuthMeApi.getInstance().isAuthenticated(player)) {
|
if (AuthMeApi.getInstance().isAuthenticated(player)) {
|
||||||
|
Reference in New Issue
Block a user