Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Stats V2

Vrekt edited this page Jan 11, 2020 · 1 revision

The StatisticsV2 class is a wrapper for StatsproxyPublicService.

Retrieving stats

final var stats = athena.statisticsV2().stats("accountId");
System.err.println(stats.wins());
final var filter = stats.filterByInputAndPlaylist(Input.KEYBOARD_AND_MOUSE, "playlist_defaultsolo");
System.err.println(filter.kills());

Query specific stats

            final var build = new StatisticsQuery.Builder(new String[]{"stat1", "stat2", "etc"}, "accountId1", "accountId2", "accountId3").build();
            final var bulk = athena.statisticsV2().query(build);
            bulk.forEach(response -> {
                System.err.println(response.getValue("stat1"));
                System.err.println(response.getValue("stat2"));
            });

There are many methods and constructors for querying, not just one.

Leaderboards

            final var leaderboards = athena.statisticsV2().leaderboard("br_placetop1_keyboardmouse_m0_playlist_defaultsolo");
            leaderboards.mapOfEntries().forEach((accountId, value) -> {
                final var find = athena.account().findByAccountId(accountId);
                System.err.println("Account: " + find.displayName() + " is " + value + " place.");
            });

// Or, to make it easier:

            final var leaderboards = athena.statisticsV2().leaderboardWithAccounts("br_placetop1_keyboardmouse_m0_playlist_defaultsolo");
            leaderboards.forEach((account, value) -> {
                System.err.println("Account: " + account.displayName() + " is " + value + " place.");
            });
Clone this wiki locally