From 89ee1a7bc73bfd0c1921f5d1867d8231d0a66dcb Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 25 Jul 2017 18:28:16 +0300 Subject: [PATCH] Fix Scatter & Length distribution graphs containing duplicate sessions --- .../djrapitops/plan/data/analysis/JoinInfoPart.java | 10 ++++------ Plan/src/main/resources/analysis.html | 2 -- Plan/src/main/resources/player.html | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/analysis/JoinInfoPart.java b/Plan/src/main/java/com/djrapitops/plan/data/analysis/JoinInfoPart.java index 940ccc98a..263065eed 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/analysis/JoinInfoPart.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/analysis/JoinInfoPart.java @@ -2,15 +2,13 @@ package main.java.com.djrapitops.plan.data.analysis; import com.djrapitops.plugin.api.TimeAmount; import com.djrapitops.plugin.utilities.Verify; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; import main.java.com.djrapitops.plan.data.SessionData; import main.java.com.djrapitops.plan.utilities.MiscUtils; import main.java.com.djrapitops.plan.utilities.analysis.AnalysisUtils; +import java.util.*; +import java.util.stream.Collectors; + /** * Part responsible for all Player login related analysis. * @@ -109,6 +107,6 @@ public class JoinInfoPart extends RawData { public void addSessions(UUID uuid, List sessions) { Verify.nullCheck(uuid); Verify.nullCheck(sessions); - this.sessions.put(uuid, sessions); + this.sessions.put(uuid, sessions.stream().distinct().collect(Collectors.toList())); } } diff --git a/Plan/src/main/resources/analysis.html b/Plan/src/main/resources/analysis.html index b39df7310..a623bbfaa 100644 --- a/Plan/src/main/resources/analysis.html +++ b/Plan/src/main/resources/analysis.html @@ -661,8 +661,6 @@ -

If the graph contains more sessions than login times, likely cause is use of /reload - (Restarts sessions).

diff --git a/Plan/src/main/resources/player.html b/Plan/src/main/resources/player.html index 3abb3da12..0e4edc5c7 100644 --- a/Plan/src/main/resources/player.html +++ b/Plan/src/main/resources/player.html @@ -549,8 +549,6 @@ -

If the graph contains more sessions than login times, likely cause is use of /reload - (Restarts sessions).