Implement bungee messaging, CacheDataSource sync

This commit is contained in:
Gabriele C
2017-10-30 10:38:13 +01:00
parent a5542051f4
commit 2d2eb740e3
21 changed files with 233 additions and 25 deletions
@@ -19,6 +19,7 @@ import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.process.SyncProcessManager;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.service.BukkitService;
import fr.xephi.authme.service.BungeeService;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.SessionService;
import fr.xephi.authme.settings.properties.DatabaseSettings;
@@ -73,6 +74,9 @@ public class AsynchronousLogin implements AsynchronousProcess {
@Inject
private SessionService sessionService;
@Inject
private BungeeService bungeeService;
AsynchronousLogin() {
}
@@ -221,6 +225,7 @@ public class AsynchronousLogin implements AsynchronousProcess {
auth.setLastLogin(System.currentTimeMillis());
auth.setLastIp(ip);
dataSource.updateSession(auth);
bungeeService.sendRefreshSession(player.getName());
// Successful login, so reset the captcha & temp ban count
final String name = player.getName();
@@ -246,6 +251,7 @@ public class AsynchronousLogin implements AsynchronousProcess {
playerCache.updatePlayer(auth);
dataSource.setLogged(name);
sessionService.grantSession(name);
bungeeService.sendLogin(name);
// As the scheduling executes the Task most likely after the current
// task, we schedule it in the end