Search in sources :

Example 6 with R4J

use of no.stelar7.api.r4j.impl.R4J in project L4J8 by stelar7.

the class RatelimitTest method testRateLimit.

@Test
@Disabled
public void testRateLimit() {
    final R4J test = new R4J(SecretFile.CREDS);
    String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
    Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
    for (int i2 = 0; i2 < 130; i2++) {
        new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
    }
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) R4J(no.stelar7.api.r4j.impl.R4J) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 7 with R4J

use of no.stelar7.api.r4j.impl.R4J in project L4J8 by stelar7.

the class FeaturedGameTest method testCurrentGame.

@Test
public void testCurrentGame() {
    final R4J r4J = new R4J(SecretFile.CREDS);
    SpectatorBuilder sb = new SpectatorBuilder().withPlatform(LeagueShard.EUW1);
    final List<SpectatorGameInfo> game = sb.getFeaturedGames();
    doAssertions.accept(game);
}
Also used : SpectatorGameInfo(no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo) R4J(no.stelar7.api.r4j.impl.R4J) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 8 with R4J

use of no.stelar7.api.r4j.impl.R4J in project L4J8 by stelar7.

the class TestSharedAccount method getShards.

@Test
@Order(3)
public void getShards() {
    R4J api = new R4J(SecretFile.CREDS);
    RiotAccount account = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7");
    RiotAccountShard shard = api.getAccountAPI().getActiveShard(RegionShard.AMERICAS, ShardableGame.LOR, account.getPUUID());
    System.out.println(shard);
    System.out.println(shard.getShardAsEnum());
}
Also used : R4J(no.stelar7.api.r4j.impl.R4J)

Example 9 with R4J

use of no.stelar7.api.r4j.impl.R4J in project L4J8 by stelar7.

the class TestVALContent method testGetContent.

@Test
public void testGetContent() {
    R4J api = new R4J(SecretFile.CREDS);
    VALContentAPI content = api.getVALAPI().getContentAPI();
    Content data = content.getContent(ValorantShard.EU, Optional.empty());
    System.out.println(data);
}
Also used : Content(no.stelar7.api.r4j.pojo.val.content.Content) VALContentAPI(no.stelar7.api.r4j.impl.val.VALContentAPI) R4J(no.stelar7.api.r4j.impl.R4J) Test(org.junit.jupiter.api.Test)

Example 10 with R4J

use of no.stelar7.api.r4j.impl.R4J in project L4J8 by stelar7.

the class DivTests method test.

@Test
public void test() {
    R4J api = new R4J(SecretFile.CREDS);
    String user = "stelar7";
    LeagueShard region = LeagueShard.EUW1;
    Summoner summoner = new SummonerBuilder().withPlatform(region).withName(user).get();
    Map<Integer, StaticChampion> champData = api.getDDragonAPI().getChampions();
    // pfp
    String pfp = ImageAPI.getInstance().getProfileIcon(region, user);
    // name and lv
    int level = summoner.getSummonerLevel();
    String name = summoner.getName();
    // most recent game
    List<String> matches = summoner.getLeagueGames().get();
    LOLMatch match = LOLMatch.get(region, matches.get(0));
    MatchParticipant self = match.getParticipants().stream().filter(p -> p.getPuuid().equals(summoner.getPUUID())).findFirst().get();
    StaticChampion champion = champData.get(self.getChampionId());
    MatchPerks summs = self.getPerks();
    boolean won = self.didWin();
    System.out.println("Profile icon: " + pfp);
    System.out.println(name + ", Level " + level);
    System.out.println();
    System.out.format(name + " %s their most recent game.", won ? "won" : "lost");
    System.out.println();
    System.out.println("They were playing " + self.getChampionSelectLane() + " " + champion.getName());
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) StaticChampion(no.stelar7.api.r4j.pojo.lol.staticdata.champion.StaticChampion) R4J(no.stelar7.api.r4j.impl.R4J) LeagueShard(no.stelar7.api.r4j.basic.constants.api.regions.LeagueShard) Test(org.junit.jupiter.api.Test)

Aggregations

R4J (no.stelar7.api.r4j.impl.R4J)20 VALMatchAPI (no.stelar7.api.r4j.impl.val.VALMatchAPI)6 Summoner (no.stelar7.api.r4j.pojo.lol.summoner.Summoner)6 Test (org.junit.jupiter.api.Test)5 RiotAccount (no.stelar7.api.r4j.pojo.shared.RiotAccount)4 SpectatorBuilder (no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)3 SummonerBuilder (no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder)3 SpectatorGameInfo (no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo)3 FileSystemCacheProvider (no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)2 LeagueShard (no.stelar7.api.r4j.basic.constants.api.regions.LeagueShard)2 StaticChampion (no.stelar7.api.r4j.pojo.lol.staticdata.champion.StaticChampion)2 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 DataCall (no.stelar7.api.r4j.basic.calling.DataCall)1 URLEndpoint (no.stelar7.api.r4j.basic.constants.api.URLEndpoint)1 VALContentAPI (no.stelar7.api.r4j.impl.val.VALContentAPI)1 VALRankedAPI (no.stelar7.api.r4j.impl.val.VALRankedAPI)1 ChampionMastery (no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery)1 no.stelar7.api.r4j.pojo.lol.match.v5 (no.stelar7.api.r4j.pojo.lol.match.v5)1 StaticMastery (no.stelar7.api.r4j.pojo.lol.staticdata.mastery.StaticMastery)1