Update ActivityLogEntry.java

This commit is contained in:
Telesphoreo 2020-11-14 20:26:49 -06:00
parent a537183545
commit 5cdbae0166

View File

@ -14,7 +14,6 @@ import org.bukkit.entity.Player;
public class ActivityLogEntry implements IConfig public class ActivityLogEntry implements IConfig
{ {
@Getter @Getter
private String configKey; private String configKey;
@Getter @Getter
@ -75,9 +74,10 @@ public class ActivityLogEntry implements IConfig
Date currentTime = Date.from(Instant.now()); Date currentTime = Date.from(Instant.now());
timestamps.add("Login: " + FUtil.dateToString(currentTime)); timestamps.add("Login: " + FUtil.dateToString(currentTime));
} }
public void addLogout() public void addLogout()
{ {
String lastLoginString = timestamps.get(timestamps.size() - 1); String lastLoginString = timestamps.get(timestamps.size() - 1); // there's a bug with subtracting the -1 here
Date currentTime = Date.from(Instant.now()); Date currentTime = Date.from(Instant.now());
timestamps.add("Logout: " + FUtil.dateToString(currentTime)); timestamps.add("Logout: " + FUtil.dateToString(currentTime));
lastLoginString = lastLoginString.replace("Login: ", ""); lastLoginString = lastLoginString.replace("Login: ", "");