mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Kick the user on incorrect login info
This commit is contained in:
parent
de22248fe0
commit
55b2fd0259
1 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
||||||
package org.geysermc.connector.network.session;
|
package org.geysermc.connector.network.session;
|
||||||
|
|
||||||
import com.github.steveice10.mc.auth.data.GameProfile;
|
import com.github.steveice10.mc.auth.data.GameProfile;
|
||||||
|
import com.github.steveice10.mc.auth.exception.request.InvalidCredentialsException;
|
||||||
import com.github.steveice10.mc.auth.exception.request.RequestException;
|
import com.github.steveice10.mc.auth.exception.request.RequestException;
|
||||||
import com.github.steveice10.mc.protocol.MinecraftProtocol;
|
import com.github.steveice10.mc.protocol.MinecraftProtocol;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
|
||||||
|
@ -281,6 +282,9 @@ public class GeyserSession implements CommandSender {
|
||||||
|
|
||||||
downstream.getSession().connect();
|
downstream.getSession().connect();
|
||||||
connector.addPlayer(this);
|
connector.addPlayer(this);
|
||||||
|
} catch (InvalidCredentialsException e) {
|
||||||
|
connector.getLogger().info("User '" + username + "' entered invalid login info, kicking.");
|
||||||
|
disconnect("Invalid/incorrect login info");
|
||||||
} catch (RequestException ex) {
|
} catch (RequestException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue