Fix player being unable to walk after admin registration

- Fix sessions still working after being disabled on reload
This commit is contained in:
ljacqu 2016-07-04 19:56:44 +02:00
parent c040623739
commit 1c3ca520dc
3 changed files with 7 additions and 5 deletions

View File

@ -27,7 +27,7 @@ public class SessionManager implements SettingsDependent {
* @return True if a session is found.
*/
public boolean hasSession(String name) {
return sessions.containsKey(name);
return enabled && sessions.containsKey(name);
}
/**

View File

@ -2,6 +2,7 @@ package fr.xephi.authme.command.executable.authme;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.limbo.LimboCache;
import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.datasource.DataSource;
@ -37,6 +38,9 @@ public class RegisterAdminCommand implements ExecutableCommand {
@Inject
private ValidationService validationService;
@Inject
private LimboCache limboCache;
@Override
public void executeCommand(final CommandSender sender, List<String> arguments) {
// Get the player name and password
@ -79,6 +83,7 @@ public class RegisterAdminCommand implements ExecutableCommand {
bukkitService.scheduleSyncDelayedTask(new Runnable() {
@Override
public void run() {
limboCache.restoreData(player);
player.kickPlayer(commandService.retrieveSingle(MessageKey.KICK_FOR_ADMIN_REGISTER));
}
});

View File

@ -5,7 +5,6 @@ import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.initialization.SettingsDependent;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.properties.RestrictionSettings;
import fr.xephi.authme.util.BukkitService;
import org.bukkit.entity.Player;
import javax.inject.Inject;
@ -23,12 +22,10 @@ public class ProtocolLibService implements SettingsDependent {
/* Service */
private boolean isEnabled;
private AuthMe plugin;
private BukkitService bukkitService;
@Inject
ProtocolLibService(AuthMe plugin, BukkitService bukkitService, NewSetting settings) {
ProtocolLibService(AuthMe plugin, NewSetting settings) {
this.plugin = plugin;
this.bukkitService = bukkitService;
loadSettings(settings);
setup();
}