Implement AuthMeBungee autologin (#1402)
* Implement AuthMeBungee autologin There is a failing test due to cyclic dependency injection, @ljacqu could you take a quick look at this? * Try to fix recursive dependency injection * Fix codestyle * Fix the subchannel name, again... * Split BungeeService into BungeeSender and BungeeReceiver
This commit is contained in:
@@ -7,9 +7,9 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.process.AsynchronousProcess;
|
||||
import fr.xephi.authme.process.SyncProcessManager;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.SessionService;
|
||||
import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import fr.xephi.authme.service.bungeecord.MessageType;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -40,7 +40,7 @@ public class AsynchronousLogout implements AsynchronousProcess {
|
||||
private SessionService sessionService;
|
||||
|
||||
@Inject
|
||||
private BungeeService bungeeService;
|
||||
private BungeeSender bungeeSender;
|
||||
|
||||
AsynchronousLogout() {
|
||||
}
|
||||
@@ -59,18 +59,18 @@ public class AsynchronousLogout implements AsynchronousProcess {
|
||||
|
||||
PlayerAuth auth = playerCache.getAuth(name);
|
||||
database.updateSession(auth);
|
||||
bungeeService.sendAuthMeBungeecordMessage(MessageType.REFRESH_SESSION, name);
|
||||
bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_SESSION, name);
|
||||
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
auth.setQuitLocation(player.getLocation());
|
||||
database.updateQuitLoc(auth);
|
||||
bungeeService.sendAuthMeBungeecordMessage(MessageType.REFRESH_QUITLOC, name);
|
||||
bungeeSender.sendAuthMeBungeecordMessage(MessageType.REFRESH_QUITLOC, name);
|
||||
}
|
||||
|
||||
playerCache.removePlayer(name);
|
||||
codeManager.unverify(name);
|
||||
database.setUnlogged(name);
|
||||
sessionService.revokeSession(name);
|
||||
bungeeService.sendAuthMeBungeecordMessage(MessageType.LOGOUT, name);
|
||||
bungeeSender.sendAuthMeBungeecordMessage(MessageType.LOGOUT, name);
|
||||
syncProcessManager.processSyncPlayerLogout(player);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user