From 1f4fdd883068758f4f494221bf8b2af25185eef9 Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+Rsl1122@users.noreply.github.com> Date: Tue, 19 Jan 2021 18:18:26 +0200 Subject: [PATCH] Added extension data support to /players page Affects issues: - #1222 --- .../plan/delivery/rendering/json/JSONFactory.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java index 65fb62125..eedd5a580 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/json/JSONFactory.java @@ -23,6 +23,7 @@ import com.djrapitops.plan.delivery.domain.mutators.TPSMutator; import com.djrapitops.plan.delivery.formatting.Formatter; import com.djrapitops.plan.delivery.formatting.Formatters; import com.djrapitops.plan.delivery.rendering.json.graphs.Graphs; +import com.djrapitops.plan.extension.implementation.results.ExtensionTabData; import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerPlayerDataTableQuery; import com.djrapitops.plan.gathering.cache.SessionCache; import com.djrapitops.plan.gathering.domain.Ping; @@ -101,9 +102,12 @@ public class JSONFactory { Database database = dbSystem.getDatabase(); + UUID mainServerUUID = database.query(ServerQueries.fetchProxyServerInformation()).map(Server::getUuid).orElse(serverInfo.getServerUUID()); + Map pluginData = database.query(new ExtensionServerPlayerDataTableQuery(mainServerUUID, xMostRecentPlayers)); + return new PlayersTableJSONCreator( database.query(new NetworkTablePlayersQuery(System.currentTimeMillis(), playtimeThreshold, xMostRecentPlayers)), - Collections.emptyMap(), + pluginData, openPlayerLinksInNewTab, formatters, locale ).toJSONString();