Skip to content

Requests: Players

Cristian "SknZ" Ferreira edited this page Apr 22, 2021 · 4 revisions

Players

There are many things about the players that you can request, such as Account Information, Status, Friends, Decks and Champions that the player plays. It is also possible to get the starting history of this player, but it will be covered on another page of the wiki.

🔍 Search Player

You can search for players by Nickname and can filter by platform.
I recommend that you use Search Player if you want to find a specific player.

// [...]
EndPoint endpoint = session.getEndPoint();
SearchPlayers result = endpoint.searchPlayer("frzgod", Platform.PC).get();
// If the Platform parameter is null, no platform will be filtered.

When searching for a player you get a collection, with all players who have the same or similar nickname.

🖥️ Player Informations

It is possible to get information about a player using his Id or Nickname. There are some disadvantages to using this method without the #searchPlayers(String, Platform)

// [...]
EndPoint endpoint = session.getEndPoint();
Player player = endpoint.getPlayer("frzgod").get(); //Nickname or Id
//or
Player player = endpoint.getPlayer("frzgod", Platform.Steam).get(); // only nickname

The disadvantage is that you will have to know exactly which Sub-Platform the player is playing on, Platform.PC or Platform.Console do not work in this method. If the platform is not specified, it will find the first player that appears, causing it not to find the exact player.
PC has 4 sub-platforms: Platform.HiRez, Platform.Steam, Platform.Discord, Platform.EpicGames;

🟢 Player Status

Shows the status of the player, whether he is online (In the lobby or Champion Selection) or in game;

// [...]
EndPoint endpoint = session.getEndPoint();
PlayerStatus status = endpoint.getPlayerStatus("frzgod").get(); //Nickname or Id
System.out.println(status.isInMatch() ? status.getMatchId() : "This player is not in the match");

🤝 Friends

You get a collection of friends that the player has. Friends with the private profile will not appear correctly.

// [...]
EndPoint endpoint = session.getEndPoint();
Friends friends = endpoint.getFriends(1384423).get(); //Only Id

🎟️ Loadouts/Decks

You get a collection of loadouts that the player has.

// [...]
EndPoint endpoint = session.getEndPoint();
Loadouts loadouts = endpoint.getLoadouts(1384423, Language.English).get(); //Only Id

Player Champions

There are 2 methods to get information about the champions the player has played: When making a request you receive a collection with all the champions played by this player.

getQueueStatus(long, Queue) you need to specify which game mode you want the information to be.

getPlayerChampions(long) which takes the total of all the information.

// [...]
EndPoint endpoint = session.getEndPoint();
QueueChampions queueChampions = endpoint.getQueueStatus(1384423, Queue.Live_Competitive_Keyboard).get(); //Only Id
// [...]
EndPoint endpoint = session.getEndPoint();
PlayerChampions queueChampions = endpoint.getPlayerChampions(1384423).get(); //Only Id

QueueChampion extends PlayerChampion class, QueueChampions contains less values than PlayerChampion for this reason that another implementation is needed.