2019-07-28 11:04:39 +02:00
|
|
|
package com.massivecraft.factions.cmd.logout;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
|
|
|
import com.massivecraft.factions.cmd.FCommand;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdLogout extends FCommand {
|
|
|
|
|
2019-08-24 19:18:50 +02:00
|
|
|
public CmdLogout() {
|
2019-07-28 11:04:39 +02:00
|
|
|
super();
|
|
|
|
this.aliases.add("logout");
|
|
|
|
|
|
|
|
this.permission = Permission.LOGOUT.node;
|
|
|
|
this.disableOnLock = true;
|
|
|
|
this.disableOnSpam = true;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
LogoutHandler handler = LogoutHandler.getByName(fme.getPlayer().getName());
|
|
|
|
|
2019-08-24 19:18:50 +02:00
|
|
|
if (handler.isLogoutActive(fme.getPlayer())) {
|
2019-07-28 11:04:39 +02:00
|
|
|
fme.msg(TL.COMMAND_LOGOUT_ACTIVE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
handler.applyLogoutCooldown(fme.getPlayer());
|
|
|
|
fme.msg(TL.COMMAND_LOGOUT_LOGGING, Conf.logoutCooldown);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-08-24 19:18:50 +02:00
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_LOGOUT_DESCRIPTION;
|
|
|
|
}
|
2019-07-28 11:04:39 +02:00
|
|
|
}
|