From a35e4fe940bd9983ab74f53dee5685dac59e5c88 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 11 Mar 2017 09:31:54 +0200 Subject: [PATCH] Fix #45 & small things - Fixed Equals method for UserData --- .../main/java/com/djrapitops/plan/data/SessionData.java | 5 +++++ .../src/main/java/com/djrapitops/plan/data/UserData.java | 9 +++------ .../com/djrapitops/plan/data/cache/DataCacheHandler.java | 9 --------- .../djrapitops/plan/data/handlers/ActivityHandler.java | 2 +- .../java/com/djrapitops/plan/utilities/HtmlUtils.java | 4 ++-- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/SessionData.java b/Plan/src/main/java/com/djrapitops/plan/data/SessionData.java index 07cf8fa8f..1711c5a0c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/SessionData.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/SessionData.java @@ -51,4 +51,9 @@ public class SessionData { public long getSessionEnd() { return sessionEnd; } + + @Override + public String toString() { + return "s:" + sessionStart + " e:" + sessionEnd; + } } diff --git a/Plan/src/main/java/com/djrapitops/plan/data/UserData.java b/Plan/src/main/java/com/djrapitops/plan/data/UserData.java index ee10fdc73..d5f98866b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/UserData.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/UserData.java @@ -681,15 +681,12 @@ public class UserData { return false; } final UserData other = (UserData) obj; - if (this.accessing != other.accessing) { - return false; - } if (this.registered != other.registered) { return false; } - if (this.lastPlayed != other.lastPlayed) { - return false; - } +// if (this.lastPlayed != other.lastPlayed) { +// return false; +// } if (this.playTime != other.playTime) { return false; } diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java index 3c3e1e796..20ad69348 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java @@ -354,15 +354,6 @@ public class DataCacheHandler { return killHandler; } - /** - * Returns the same value as Plan#getDB(). - * - * @return Current instance of the Database, - */ - public Database getDB() { - return db; - } - /** * * @return diff --git a/Plan/src/main/java/com/djrapitops/plan/data/handlers/ActivityHandler.java b/Plan/src/main/java/com/djrapitops/plan/data/handlers/ActivityHandler.java index cd59af327..e3c8f3341 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/handlers/ActivityHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/handlers/ActivityHandler.java @@ -33,7 +33,7 @@ public class ActivityHandler { * @return true if data is not found. */ public boolean isFirstTimeJoin(UUID uuid) { - return !handler.getDB().wasSeenBefore(uuid); + return !plugin.getDB().wasSeenBefore(uuid); } /** diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java index 255faf76c..e75f0d036 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java @@ -43,7 +43,7 @@ public class HtmlUtils { */ public static String replacePlaceholders(String html, HashMap replaceMap) { for (String key : replaceMap.keySet()) { - html = html.replaceAll(key, replaceMap.get(key)); + html = html.replace(key, replaceMap.get(key)); } return html; } @@ -81,7 +81,7 @@ public class HtmlUtils { return url; } - static String removeXSS(String string) { + public static String removeXSS(String string) { return string.replaceAll("", "") .replaceAll("