diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java index 49218e6c7..3093dfee6 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java @@ -295,7 +295,7 @@ public class SessionsTable extends UserIDTable { try { statement = prepareStatement("SELECT " + "(SUM(" + columnSessionEnd + ") - SUM(" + columnSessionStart + ")) as playtime, " + - columnServerID + "," + + columnServerID + " FROM " + tableName + " WHERE " + columnSessionStart + ">?" + " AND " + columnUserID + "=" + usersTable.statementSelectID); diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java index cdf1fb826..c5aa9beaf 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java @@ -101,10 +101,13 @@ public class InspectPageParser { .collect(Collectors.toList()); int sessionCountDay = sessionsDay.size(); - int sessionCountWeek = sessionsDay.size(); + int sessionCountWeek = sessionsWeek.size(); long playtimeDay = AnalysisUtils.getTotalPlaytime(sessionsDay); long playtimeWeek = AnalysisUtils.getTotalPlaytime(sessionsWeek); + addValue("sessionLengthLongestDay", FormatUtils.formatTimeAmount(sessionsDay.get(0).getLength())); + addValue("sessionLengthLongestWeek", FormatUtils.formatTimeAmount(sessionsWeek.get(0).getLength())); + addValue("sessionCountDay", sessionCountDay); addValue("sessionCountWeek", sessionCountWeek); addValue("playtimeDay", FormatUtils.formatTimeAmount(playtimeDay)); @@ -130,7 +133,9 @@ public class InspectPageParser { addValue("lastSeen", FormatUtils.formatTimeAmount(playTime)); String puchCardData = PunchCardGraphCreator.createDataSeries(allSessions); - List sessionsInLengthOrder = allSessions.stream().sorted(new SessionLengthComparator()).collect(Collectors.toList()); + List sessionsInLengthOrder = allSessions.stream() + .sorted(new SessionLengthComparator()) + .collect(Collectors.toList()); if (sessionsInLengthOrder.isEmpty()) { addValue("sessionLengthMedian", "No Sessions"); addValue("sessionLengthLongest", "No Sessions"); @@ -163,7 +168,7 @@ public class InspectPageParser { String banned = isBanned ? "Banned" : ""; String op = isOP ? "Operator (OP)" : ""; - addValue("playerclassification", HtmlStructure.separateWithDots(active, banned, op)); + addValue("playerClassification", HtmlStructure.separateWithDots(active, banned, op)); } private void addValue(String placeholder, Serializable value) { diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/server/ServerInfoManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/server/ServerInfoManager.java index b30811f62..bbf283603 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/server/ServerInfoManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/server/ServerInfoManager.java @@ -73,7 +73,7 @@ public class ServerInfoManager { String name = Settings.SERVER_NAME.toString(); String webAddress = plugin.getWebServer().getAccessAddress(); if ("plan".equalsIgnoreCase(name)) { - name = "Server" + serverID.get(); + name = "Server " + serverID.get(); } serverInfo = new ServerInfo(serverID.get(), serverUUID, name, webAddress); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionLengthComparator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionLengthComparator.java index 3855c2828..0da331c4d 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionLengthComparator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionLengthComparator.java @@ -11,6 +11,6 @@ public class SessionLengthComparator implements Comparator { @Override public int compare(Session s1, Session s2) { - return Long.compare(s1.getLength(), s2.getLength()); + return -Long.compare(s1.getLength(), s2.getLength()); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionStartComparator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionStartComparator.java index 6d9f90d7d..85bd39e6a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionStartComparator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/SessionStartComparator.java @@ -11,6 +11,6 @@ public class SessionStartComparator implements Comparator { @Override public int compare(Session s1, Session s2) { - return Long.compare(s1.getSessionStart(), s2.getSessionStart()); + return -Long.compare(s1.getSessionStart(), s2.getSessionStart()); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/StringLengthComparator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/StringLengthComparator.java index 441edd2f3..142739ed0 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/StringLengthComparator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/StringLengthComparator.java @@ -12,6 +12,6 @@ public class StringLengthComparator implements Comparator { @Override public int compare(String o1, String o2) { - return -Integer.compare(o1.length(), o2.length()); + return Long.compare(o1.length(), o2.length()); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java index ff6b3948d..2c734cb33 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlStructure.java @@ -48,9 +48,7 @@ public class HtmlStructure { } builder.append("• "); builder.append(element); - if (i < elements.length - 1) { - builder.append("
"); - } + builder.append("
"); } return builder.toString(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/ActionsTableCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/ActionsTableCreator.java index 69a346f0d..e1226293a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/ActionsTableCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/ActionsTableCreator.java @@ -36,7 +36,7 @@ public class ActionsTableCreator { long date = action.getDate(); html.append(Html.TABLELINE_3_CUSTOMKEY_1.parse( - String.valueOf(date), FormatUtils.formatTimeStamp(date), + String.valueOf(date), FormatUtils.formatTimeStampYear(date), action.getDoneAction().toString(), action.getAdditionalInfo() )); diff --git a/Plan/test/test/java/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java b/Plan/test/test/java/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java index 501f24507..44fe4dd6f 100644 --- a/Plan/test/test/java/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java +++ b/Plan/test/test/java/main/java/com/djrapitops/plan/utilities/comparators/ComparatorTest.java @@ -35,6 +35,7 @@ public class ComparatorTest { List test = RandomData.randomSessions(); List longValues = test.stream().map(Session::getSessionStart).collect(Collectors.toList()); longValues.sort(Long::compare); + Collections.reverse(longValues); test.sort(new SessionStartComparator()); List afterSort = test.stream().map(Session::getSessionStart).collect(Collectors.toList()); assertEquals(longValues, afterSort);