diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java index 754202d83..e05431ce2 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java @@ -121,7 +121,7 @@ public class PlayerPageExporter extends FileExporter { String jsonResourceName = toFileName(toJSONResourceName(resource)) + ".json"; export(toDirectory.resolve(jsonResourceName), found.get().getBytes()); - exportPaths.put("../v1/player?player=${encodeURIComponent(playerName)}", "./" + jsonResourceName); + exportPaths.put("../v1/player?player=${encodeURIComponent(playerUUID)}", "./" + jsonResourceName); } private String toJSONResourceName(String resource) { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPage.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPage.java index 816f2d32b..8eaa81274 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPage.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PlayerPage.java @@ -100,6 +100,7 @@ public class PlayerPage implements Page { String playerName = player.getValue(PlayerKeys.NAME).orElse(playerUUID.toString()); placeholders.put("playerName", playerName); + placeholders.put("playerUUID", playerUUID); placeholders.put("timeZone", config.getTimeZoneOffsetHours()); placeholders.put("gmPieColors", theme.getValue(ThemeVal.GRAPH_GM_PIE)); diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/auth/ActiveCookieExpiryCleanupTask.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/auth/ActiveCookieExpiryCleanupTask.java index 771d5e83a..86d835353 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/auth/ActiveCookieExpiryCleanupTask.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/auth/ActiveCookieExpiryCleanupTask.java @@ -60,28 +60,29 @@ public class ActiveCookieExpiryCleanupTask extends TaskSystem.Task { @Override public void run() { long time = System.currentTimeMillis(); - Set removed = new HashSet<>(); + + Set cookiesToRemove = new HashSet<>(); for (Map.Entry entry : expiryDates.entrySet()) { Long expiryTime = entry.getValue(); - if (config.isTrue(PluginSettings.DEV_MODE)) { - logger.info("Cookie " + entry.getKey() + " will expire " + expiryTime); - } if (expiryTime <= time) { String cookie = entry.getKey(); - activeCookieStore.get().removeCookie(cookie); - removed.add(cookie); + cookiesToRemove.add(cookie); } } - for (String removedCookie : removed) { - expiryDates.remove(removedCookie); + for (String cookie : cookiesToRemove) { + activeCookieStore.get().removeCookie(cookie); + expiryDates.remove(cookie); if (config.isTrue(PluginSettings.DEV_MODE)) { - logger.info("Cookie " + removedCookie + " has expired: " + time); + logger.info("Cookie " + cookie + " has expired: " + time); } } } public void addExpiry(String cookie, Long time) { expiryDates.put(cookie, time); + if (config.isTrue(PluginSettings.DEV_MODE)) { + logger.info("Cookie " + cookie + " will expire " + time); + } } } diff --git a/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js b/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js index a4e1ee544..97f8c24fb 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js @@ -110,13 +110,13 @@ function newConfiguredXHR(callback) { callback(null, "Request did not reach the server. (Server offline / Adblocker?)") } } catch (e) { - callback(null, e.message + " (See " + address + ")") + callback(null, e.message) } } }; xhr.timeout = 45000; xhr.ontimeout = function () { - callback(null, "Timed out after 45 seconds. (" + address + ")") + callback(null, "Timed out after 45 seconds.") }; return xhr; diff --git a/Plan/common/src/main/resources/assets/plan/web/player.html b/Plan/common/src/main/resources/assets/plan/web/player.html index 754f8137a..61f32a15d 100644 --- a/Plan/common/src/main/resources/assets/plan/web/player.html +++ b/Plan/common/src/main/resources/assets/plan/web/player.html @@ -717,9 +717,9 @@ Highcharts.setOptions({ lang: {noData: "No Data to Display"}, time: {timezoneOffset: ${timeZone} * 60} }); - const playerName = '${playerName}'; + const playerUUID = '${playerUUID}'; setLoadingText('Loading player values..'); - jsonRequest(`../v1/player?player=${encodeURIComponent(playerName)}`, function (json, error) { + jsonRequest(`../v1/player?player=${encodeURIComponent(playerUUID)}`, function (json, error) { loadPlayerOverviewValues(json, error); loadSessionAccordion(json, error); loadserverAccordion(json, error);