Fix #45 & small things

- Fixed Equals method for UserData
This commit is contained in:
Rsl1122 2017-03-11 09:31:54 +02:00
parent 446af674b8
commit a35e4fe940
5 changed files with 11 additions and 18 deletions

View File

@ -51,4 +51,9 @@ public class SessionData {
public long getSessionEnd() { public long getSessionEnd() {
return sessionEnd; return sessionEnd;
} }
@Override
public String toString() {
return "s:" + sessionStart + " e:" + sessionEnd;
}
} }

View File

@ -681,15 +681,12 @@ public class UserData {
return false; return false;
} }
final UserData other = (UserData) obj; final UserData other = (UserData) obj;
if (this.accessing != other.accessing) {
return false;
}
if (this.registered != other.registered) { if (this.registered != other.registered) {
return false; return false;
} }
if (this.lastPlayed != other.lastPlayed) { // if (this.lastPlayed != other.lastPlayed) {
return false; // return false;
} // }
if (this.playTime != other.playTime) { if (this.playTime != other.playTime) {
return false; return false;
} }

View File

@ -354,15 +354,6 @@ public class DataCacheHandler {
return killHandler; return killHandler;
} }
/**
* Returns the same value as Plan#getDB().
*
* @return Current instance of the Database,
*/
public Database getDB() {
return db;
}
/** /**
* *
* @return * @return

View File

@ -33,7 +33,7 @@ public class ActivityHandler {
* @return true if data is not found. * @return true if data is not found.
*/ */
public boolean isFirstTimeJoin(UUID uuid) { public boolean isFirstTimeJoin(UUID uuid) {
return !handler.getDB().wasSeenBefore(uuid); return !plugin.getDB().wasSeenBefore(uuid);
} }
/** /**

View File

@ -43,7 +43,7 @@ public class HtmlUtils {
*/ */
public static String replacePlaceholders(String html, HashMap<String, String> replaceMap) { public static String replacePlaceholders(String html, HashMap<String, String> replaceMap) {
for (String key : replaceMap.keySet()) { for (String key : replaceMap.keySet()) {
html = html.replaceAll(key, replaceMap.get(key)); html = html.replace(key, replaceMap.get(key));
} }
return html; return html;
} }
@ -81,7 +81,7 @@ public class HtmlUtils {
return url; return url;
} }
static String removeXSS(String string) { public static String removeXSS(String string) {
return string.replaceAll("<!--", "") return string.replaceAll("<!--", "")
.replaceAll("-->", "") .replaceAll("-->", "")
.replaceAll("<script>", "") .replaceAll("<script>", "")