Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/net/elytrium/limboauth/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ public static class STRINGS {
public String TOTP_RECOVERY = "{PRFX} &aYour recovery codes &7(Click to copy)&a: &6{0}";

public String DESTROY_SESSION_SUCCESSFUL = "{PRFX} &eYour session is now destroyed, you'll need to log in again after reconnecting.";
public String DESTROY_SESSION_KICK = "{PRFX} &eYour session has been destroyed. Please reconnect to log in again.";

public String MOD_SESSION_EXPIRED = "{PRFX} Your session has expired, log in again.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,25 @@ public class DestroySessionCommand extends RatelimitedCommand {

private final LimboAuth plugin;

private final Component successful;
private final Component kick;
private final Component notPlayer;
private final Component successful;

public DestroySessionCommand(LimboAuth plugin) {
this.plugin = plugin;

Serializer serializer = LimboAuth.getSerializer();
this.successful = serializer.deserialize(Settings.IMP.MAIN.STRINGS.DESTROY_SESSION_SUCCESSFUL);
this.kick = serializer.deserialize(Settings.IMP.MAIN.STRINGS.DESTROY_SESSION_KICK);
this.notPlayer = serializer.deserialize(Settings.IMP.MAIN.STRINGS.NOT_PLAYER);
}

@Override
public void execute(CommandSource source, String[] args) {
if (source instanceof Player) {
this.plugin.removePlayerFromCache(((Player) source).getUsername());
source.sendMessage(this.successful);
if (source instanceof Player player) {
this.plugin.removePlayerFromCache(player.getUsername());
player.sendMessage(this.successful);
player.disconnect(this.kick);
} else {
source.sendMessage(this.notPlayer);
}
Expand Down