mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-01 20:31:25 +01:00
Show captcha at login, if active.
This commit is contained in:
parent
90e32942cb
commit
152b68f5b4
@ -8,6 +8,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
||||
|
||||
@ -204,6 +205,20 @@ public class ChatListener implements Listener, INotifyReload {
|
||||
if (noPwnage.isEnabled(player) && noPwnage.checkLogin(player))
|
||||
event.disallow(Result.KICK_OTHER, cc.noPwnageReloginKickMessage);
|
||||
}
|
||||
|
||||
@EventHandler(
|
||||
priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final ChatConfig cc = ChatConfig.getConfig(player);
|
||||
final ChatData data = ChatData.getData(player);
|
||||
if (captcha.isEnabled(player) && captcha.shouldCheckCaptcha(cc, data)){
|
||||
// shouldCheckCaptcha: only if really enabled.
|
||||
// Later: add check for cc.captchaOnLogin or so.
|
||||
// TODO: maybe schedule this to coma after other plugins messages.
|
||||
captcha.sendNewCaptcha(player, cc, data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReload() {
|
||||
|
Loading…
Reference in New Issue
Block a user