Search in sources :

Example 1 with ExtensionTabData

use of com.djrapitops.plan.extension.implementation.results.ExtensionTabData in project Plan by plan-player-analytics.

the class JSONFactory method networkPlayersTableJSON.

public Map<String, Object> networkPlayersTableJSON() {
    Integer xMostRecentPlayers = config.get(DisplaySettings.PLAYERS_PER_PLAYERS_PAGE);
    Long playtimeThreshold = config.get(TimeSettings.ACTIVE_PLAY_THRESHOLD);
    boolean openPlayerLinksInNewTab = config.isTrue(DisplaySettings.OPEN_PLAYER_LINKS_IN_NEW_TAB);
    Database database = dbSystem.getDatabase();
    ServerUUID mainServerUUID = database.query(ServerQueries.fetchProxyServerInformation()).map(Server::getUuid).orElse(serverInfo.getServerUUID());
    Map<UUID, ExtensionTabData> pluginData = database.query(new ExtensionServerTableDataQuery(mainServerUUID, xMostRecentPlayers));
    return new PlayersTableJSONCreator(database.query(new NetworkTablePlayersQuery(System.currentTimeMillis(), playtimeThreshold, xMostRecentPlayers)), pluginData, openPlayerLinksInNewTab, formatters, locale, // players page
    true).toJSONMap();
}
Also used : ExtensionTabData(com.djrapitops.plan.extension.implementation.results.ExtensionTabData) NetworkTablePlayersQuery(com.djrapitops.plan.storage.database.queries.objects.playertable.NetworkTablePlayersQuery) ServerUUID(com.djrapitops.plan.identification.ServerUUID) Database(com.djrapitops.plan.storage.database.Database) ExtensionServerTableDataQuery(com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerTableDataQuery) ServerUUID(com.djrapitops.plan.identification.ServerUUID)

Aggregations

ExtensionTabData (com.djrapitops.plan.extension.implementation.results.ExtensionTabData)1 ExtensionServerTableDataQuery (com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerTableDataQuery)1 ServerUUID (com.djrapitops.plan.identification.ServerUUID)1 Database (com.djrapitops.plan.storage.database.Database)1 NetworkTablePlayersQuery (com.djrapitops.plan.storage.database.queries.objects.playertable.NetworkTablePlayersQuery)1