Start working on #687

Next step: Future return of the async registration
This commit is contained in:
Gabriele C
2016-05-04 18:01:47 +02:00
parent 552ecb5d8e
commit 1ea2f98727
5 changed files with 27 additions and 13 deletions
@@ -40,8 +40,8 @@ public class Management {
runTask(new AsynchronousLogout(player, plugin, dataSource, processService));
}
public void performRegister(final Player player, final String password, final String email) {
runTask(new AsyncRegister(player, password, email, plugin, dataSource, playerCache, processService));
public void performRegister(final Player player, final String password, final String email, final boolean autoLogin) {
runTask(new AsyncRegister(player, password, email, plugin, dataSource, playerCache, processService, autoLogin));
}
public void performUnregister(final Player player, final String password, final boolean force) {
@@ -37,9 +37,10 @@ public class AsyncRegister implements Process {
private final DataSource database;
private final PlayerCache playerCache;
private final ProcessService service;
private final boolean autoLogin;
public AsyncRegister(Player player, String password, String email, AuthMe plugin, DataSource data,
PlayerCache playerCache, ProcessService service) {
PlayerCache playerCache, ProcessService service, boolean autoLogin) {
this.player = player;
this.password = password;
this.name = player.getName().toLowerCase();
@@ -49,6 +50,7 @@ public class AsyncRegister implements Process {
this.ip = Utils.getPlayerIp(player);
this.playerCache = playerCache;
this.service = service;
this.autoLogin = autoLogin;
}
private boolean preRegisterCheck() {
@@ -150,7 +152,7 @@ public class AsyncRegister implements Process {
return;
}
if (!Settings.forceRegLogin) {
if (!Settings.forceRegLogin && autoLogin) {
//PlayerCache.getInstance().addPlayer(auth);
//database.setLogged(name);
// TODO: check this...