space after 'if'(s)

This commit is contained in:
HexelDev 2018-03-05 20:20:25 +01:00
parent 57809194f3
commit 11d039c818

View File

@ -47,11 +47,11 @@ public class SessionService implements Reloadable {
PlayerAuth auth = database.getAuth(name); PlayerAuth auth = database.getAuth(name);
SessionState state = fetchSessionStatus(auth, player); SessionState state = fetchSessionStatus(auth, player);
if(state.equals(SessionState.VALID)) { if (state.equals(SessionState.VALID)) {
RestoreSessionEvent event = bukkitService.createAndCallEvent( RestoreSessionEvent event = bukkitService.createAndCallEvent(
isAsync -> new RestoreSessionEvent(player, isAsync)); isAsync -> new RestoreSessionEvent(player, isAsync));
return !event.isCancelled(); return !event.isCancelled();
} else if(state.equals(SessionState.IP_CHANGED)) { } else if (state.equals(SessionState.IP_CHANGED)) {
service.send(player, MessageKey.SESSION_EXPIRED); service.send(player, MessageKey.SESSION_EXPIRED);
} }
} }
@ -68,7 +68,6 @@ public class SessionService implements Reloadable {
*/ */
private SessionState fetchSessionStatus(PlayerAuth auth, Player player) { private SessionState fetchSessionStatus(PlayerAuth auth, Player player) {
if (auth == null) { if (auth == null) {
ConsoleLogger.warning("No PlayerAuth in database for '" + player.getName() + "' during session check"); ConsoleLogger.warning("No PlayerAuth in database for '" + player.getName() + "' during session check");
return SessionState.NOT_VALID; return SessionState.NOT_VALID;
} else if (auth.getLastLogin() == null) { } else if (auth.getLastLogin() == null) {
@ -76,9 +75,9 @@ public class SessionService implements Reloadable {
} }
long timeSinceLastLogin = System.currentTimeMillis() - auth.getLastLogin(); long timeSinceLastLogin = System.currentTimeMillis() - auth.getLastLogin();
if(timeSinceLastLogin > 0 if (timeSinceLastLogin > 0
&& timeSinceLastLogin < service.getProperty(PluginSettings.SESSIONS_TIMEOUT) * MILLIS_PER_MINUTE) { && timeSinceLastLogin < service.getProperty(PluginSettings.SESSIONS_TIMEOUT) * MILLIS_PER_MINUTE) {
if(PlayerUtils.getPlayerIp(player).equals(auth.getLastIp())) { if (PlayerUtils.getPlayerIp(player).equals(auth.getLastIp())) {
return SessionState.VALID; return SessionState.VALID;
} else { } else {
return SessionState.IP_CHANGED; return SessionState.IP_CHANGED;