Giter VIP home page Giter VIP logo

r4j's Introduction

Build Status

R4J isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.

How do I use it?

Check out one of the many tests, as they provide good examples.

What features does it have?
Type Supported
V5 compatible? Yes!
Rate-limiting? Set dynamically based on your key!
Cache Supported
FileSystem Yes!
Memory Partly...
SQL Not yet :(

How do I download?

For maven / gradle / sbt / leiningen: Jitpack
For a JAR file: Releases

Javadoc?

Click here

How do I async?

Wrap the method-call in CompletableFuture

CompletableFuture.supplyAsync(() -> api.getSummonerAPI().getSummonerByAccount(Platform.EUW1, Constants.TEST_ACCOUNT_IDS[0])).thenAccept(this::handleSummonerCallback);

private void handleSummonerCallback(Summoner u)
{
    System.out.println(u);
}

more examples here

TODO:

  • Add ALL methods to MemoryCacheProvider
  • Add support for sql storage (hibernate?)
  • Add ddragon as an alternative to static-data

r4j's People

Contributors

bentzeh avatar blossomishymae avatar dallin-cawley avatar gxxglyeyez avatar idannn98 avatar kalunight avatar michaeldsim avatar mohasaid avatar niliusjulius avatar panzer1119 avatar samdobsondev avatar spaykit avatar stelar7 avatar yonygreen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

r4j's Issues

🚀 Automatically update docs with new releases

Problem

The current docs at https://stelar7.no/l4j8/ are for version 1.7.3. They don't contain documentation for newer endpoints like match-v5 and contain documentation for endpoints that no longer can be called, like match-v4.

Solution

Generate and deploy documentation when there are new releases. This would preferably be done in some some automated fashion with pipelines like Travis or GitHub Actions.

Example

Using the GitHub Action sebastianpopp/ftp-action.

- name: Generate Docs
  run: mvn javadoc:javadoc
- name: Upload Docs
  uses: sebastianpopp/ftp-action@releases/v2
  with:
    host: ${{ secrets.FTP_SERVER }}
    user: ${{ secrets.FTP_USERNAME }}
    password: ${{ secrets.FTP_PASSWORD }}
    localDir: "docs"
    remoteDir: "www/l4j8"

Chine

Espoir peut soutenir la plate-forme chinoise

Source License

It's a good idea to add a license file to the repository so that people know under what terms the source may be used.

429 Hitted without application reboot

Hello @stelar7!

I have a question about R4J (which is really great by the way, thanks for the work you do on it). Indeed I noticed a problem within my application related to a strange rate limit problem.

My application has several threads making requests through R4J. It turns out that every hour, my application refreshes the data of registered users and a big burst of requests is executed.

So far, nothing special. The problem is that for some obscure reason, I manage to get very regular and reliable 429s (about every 2 hours). I get after a few seconds simultaneously on several threads this error:

"429 ratelimit hit! Please do not restart your application to refresh the timer! This isn't supposed to happen unless you restarted your app before the last limit was hit!"

Which I don't do, so there's a problem. I've sent the thread error messages below. You can see that it's the application limit on EUW1 that has been hit, the problem being that it can't see it. To me it looks like a multithreading problem but from what I've seen in the R4J sources it's supposed to be a managed problem. Do you have any idea where the problem could come from?

It might not be too annoying for the application to work but it causes a freeze of about 20 minutes afterwards (when it should be a freeze of maximum 10 seconds which is also weird).

Thanks for your help!

Error log: https://cdn.discordapp.com/attachments/559697775680552960/1065302125787226223/message.txt

StaticLoRCard name error in region variable and regionRef

Problem

Version 2.1.19

The function loadCards in the class LoRStaticAPI is loading all regions and regionRefs null.

Description

The library is calling and parsing data of cards from static api and loading to a list of StaticLoRCard but the name of key in the Json file and variable in StaticLoRCard is different.
Need change the name of variables in StaticLoRCard from region to regions, and regionRef to regionRefs and the two now are lists.

imagen
imagen

GameQueueType missing ARAM Clash

Hello!

The GameQueueType Enum is missing "ARAM Clash games".
The QueueId is 720.

Caused by: no.stelar7.api.r4j.basic.exceptions.APIEnumNotUpToDateException: The enum no.stelar7.api.r4j.basic.constants.types.lol.GameQueueType is missing the type 720.0!
Please make sure you have the latest version of the library!

Serialize raw json

hi @stelar7

I have two service and use another library for using riot api each service.
But when i serialize LOLMatch and LOLTimeline, it's not like Riot API Response.
I'm using json serialize library Jackson, How can i serialize class to same API response?

Especially, Enum (ex. TeamType, SpellSlotType, GameModeType, ...) had lots problem.
I tried to override serializer/deserializer for each enum, but there are too many enums and some enums are irreversible (ex. SpellSlotType).

Thanks.

ClassNotFoundException

Hello,
I was trying to use your library in my Android Studio project and ran into this error :

Error:java.lang.ClassNotFoundException: Class javafx.util.Pair not found
Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --output Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\desugar\debug\7.jar --input Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --output Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\desugar\debug\16.jar --input Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\desugar\debug\4.jar --input Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\18.jar --output Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\desugar\debug\19.jar --input Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --output Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\desugar\debug\6.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\classes\debug --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\17.jar --classpath_entry Z:\Development Projects\LeagueofLegends\app\build\intermediates\transforms\stackFramesFixer\debug\18.jar --bootclasspath_entry C:\Users\User\AppData\Local\Android\Sdk\platforms\android-26\android.jar --bootclasspath_entry C:\Users\User\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Java\jdk1.8.0_91\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Java\jdk1.8.0_91\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Java\jdk1.8.0_91\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Java\jdk1.8.0_91\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Java\jdk1.8.0_91\jre\lib\charsets.jar --bootclasspath_entry C:\Program Files\Java\jdk1.8.0_91\jre\lib\jfr.jar --min_sdk_version 19 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
Error:java.lang.ClassNotFoundException: Class javafx.util.Pair not found

I m already using java 8 and I tried to clean - rebuild the project and still got the same error.
I have also set multiDexEnabled to true.
The library dependency is set correctly.
My Android Studio version is : 3.0.1 and I m using Gradle 3.0.1
Any help would be really appreciated.

Feature request: Allow credentials to be set per API call

To set credentials you do something like R4J(APICredentials(apiKey)). This updates global state such that any subsequent API operation uses those credentials. This works fine if you're only using one Riot API key but not well at all if you have multiple in one application (TFT, League, etc.)

I am requesting an enhancement to the API where you can set the credentials per call. For example, instead of Summoner.byAccountId(leagueShard, id), maybe you could do Summoner.byAccountId(leagueShard, id).withCredentials(APICredentials(apiKey)).

Thanks!

NullPointerException at LOLMatch#gameEndTimestamp

Hello, while coding with your (really wonderful) library i encounted the following problem:

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because "this.gameEndTimestamp" is null
at no.stelar7.api.r4j.pojo.lol.match.v5.LOLMatch.getGameEndTimestamp(LOLMatch.java:99) ~[R4J-2.1.18.jar:na]

The error is caused by the method LOLMatch#getGameEndTimestamp if you try to get match data from matches prior to patch 11.20.

The gameEndTimestamp is 'Long' while the return-type being 'long'. This gets converted by the method 'Long.longValue()' and if gameEndTimestamp is null it throws this NullPointerException.

GameEndTimestamp can be null because matches prior to patch 11.20 don't have this field.

Problem with Ultra Rapid Fire

no.stelar7.api.r4j.basic.exceptions.APIEnumNotUpToDateException: The enum no.stelar7.api.r4j.basic.constants.types.lol.GameQueueType is missing the type 1900.0!
i think its a problem with this game type

Access Denied

I don't really know if this is an issue with the wrapper or with my code but i'm at a loss...
So i try to receive the matchlist of a accountId
l4j8.getMatchAPI().getMatchList(region,accountId,null,null,null,null,queueTypes,null,null);

but this allways returns some AccessDenied Error
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>A28BD5597C8B5D54</RequestId><HostId>m2IvLEnE2o0m4pBUccc8iK9KJ/BSa5NA12vO691BLzFZKQ9CGsvUrcI1CNnmd1rc2bBQS6ippTY=</HostId></Error>

if i try my api key and the accountId with the pure link it works. If you got an idea where this is coming from let me know.

Enum<Platform>

I cant import correctly the enum Platform, im using LeagueShard instead to see if it works out. But i cant use Platform.EUW1 for example i dont know why

coust found issues

  • When the caller returns null, it should return an empty list for ALL methods that return a list. It doesnt do this for some calls.

  • SUMMONER_BY_PUUID doesnt set the platform in the postProcessing

Exception: EventType missing "PAUSE_START"

Hi everyone!
An excepcion just happened to me, just running as usual, maybe too many requests over time...?.
With lastest version .jar:

Exception in thread "main" no.stelar7.api.r4j.basic.exceptions.APIEnumNotUpToDateException: The enum no.stelar7.api.r4j.basic.constants.types.lol.EventType is missing the type "PAUSE_START"!
Please make sure you have the latest version of the library!
If you do, send this message to the maintainer of the API.
	at no.stelar7.api.r4j.basic.serializer.GenericEnumSerializer.lambda$deserialize$2(GenericEnumSerializer.java:23)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at no.stelar7.api.r4j.basic.serializer.GenericEnumSerializer.deserialize(GenericEnumSerializer.java:23)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
	at com.google.gson.Gson.fromJson(Gson.java:932)
	at com.google.gson.Gson.fromJson(Gson.java:1003)
	at com.google.gson.Gson.fromJson(Gson.java:975)
	at no.stelar7.api.r4j.pojo.shared.GAMHSMatch.asLOLTimeline(GAMHSMatch.java:44)
	at no.stelar7.api.r4j.impl.lol.builders.matchv5.match.TimelineBuilder.getTimeline(TimelineBuilder.java:61)
	at SoloScout.getTimelineData(SoloScout.java:696)
	at SoloScout.scoutTo(SoloScout.java:280)
	at SoloScout.scoutTeam(SoloScout.java:367)
	at SoloScout.main(SoloScout.java:989)

Process finished with exit code 1

Thank you for the feedback and have a nice day!

Summoner Endpoints get cached for a year

The Endpoints V4_SUMMONER_BY_NAME, V4_SUMMONER_BY_PUUID, V4_SUMMONER_BY_ACCOUNT, V4_SUMMONER_BY_ID get cached for a year by default. I think that's a bit too long as player level and profile icon will realistically never update.

statPerk is always 0

Methods getStatPerk1(), getStatPerk2() and getStatPerk3() always return 0 for MatchPerks object

Toggle cache/specify location

trying to reuse this library in a lambda function, which only gives write permission to /tmp directory. Would be nice to be able to toggle the disk cache or only use memory

APIEnumNotUpToDateException

Hey there,
I've tried to access the match history of users and cam across a problem. When i call the method wich uses matchAPI.getMatchList this error is thrown:
Caused by: no.stelar7.api.l4j8.basic.exceptions.APIEnumNotUpToDateException: The enum no.stelar7.api.l4j8.basic.constants.types.LaneType is missing the type "NONE"! Please make sure you have the latest version of the library! If you do, send this message to the maintainer of the API. at no.stelar7.api.l4j8.basic.deserializer.LaneTypeDeserializer.lambda$deserialize$0(LaneTypeDeserializer.java:16) at java.util.Optional.orElseThrow(Optional.java:290) at no.stelar7.api.l4j8.basic.deserializer.LaneTypeDeserializer.deserialize(LaneTypeDeserializer.java:16) at no.stelar7.api.l4j8.basic.deserializer.LaneTypeDeserializer.deserialize(LaneTypeDeserializer.java:9) at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82) at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.Gson.fromJson(Gson.java:888) at com.google.gson.Gson.fromJson(Gson.java:853) at com.google.gson.Gson.fromJson(Gson.java:802) at no.stelar7.api.l4j8.basic.calling.DataCallBuilder.build(DataCallBuilder.java:76) at no.stelar7.api.l4j8.impl.raw.MatchAPI.getMatchList(MatchAPI.java:105) at de.gaming_ww.discordbot.core.LeagueOfLegends.RiotApiRequests.getRecentPre

I wanted to ask if this is an issue from my side or if it's an issue with the wrapper and how this could be avoided.

SummonerAPI#getSummonerByName not working in 2 letters korean

In the case of the Korean summoner's name, 3 letters, including a space, are possible.

The value of SUMMONER_NAME_PLACEHOLDER is set through A, excluding white spaces.

other case RIOT summoner v4 api works, bu in case of 2 letter korean, it doesn't work.

  1. search 삼재 excluding white spaces
1. request
curl --location --request GET 'https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/삼재' \
--header 'X-Riot-Token: ${RIOT_TOKEN}'

=================

2. response
{
    "status": {
        "message": "Data not found - summoner not found",
        "status_code": 404
    }
}
  1. search 삼 재 including white spaces
1. request
curl --location --request GET 'https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/삼 재' \
--header 'X-Riot-Token: ${RIOT_TOKEN}'

=================

2. response
{
    "id": "AQFycDGccB-7F4yNqBJQm2SxUPN-BZEScORQxzaki6PYNfw",
    "accountId": "KZq42AL80n6BD_HnzXUnRjgHm6zF-NfZeMY9eQT8oKwbn1DadlbSdyUW",
    "puuid": "SK8_OVHyTfOW__-eKgdIjboBj_5BkSOwYh0iPYRsKfamHwSZ_c5H-T5OB6LKGmnncAkKn8bBJtZlwQ",
    "name": "삼 재 ",
    "profileIconId": 4629,
    "revisionDate": 1621368768000,
    "summonerLevel": 169
}

Summoner not found with /lol/summoner/v4/summoners/by-name/ while existing

Hello @stelar7 ! I hope everthing goes well on your side.

I think I found two problems related to the endpoint /lol/summoner/v4/summoners/by-name/

First problem:
The nickname "Y K" in NA is impossible to find. But it really exists. OPGG: https://na.op.gg/summoners/na/Y%20K

The problem comes from Utils.normalizeString(args1). Just remove the data.replaceAll("\s+", "") should be enough to fix the issue. But I don't know if it had any use before that.

Second problem:
Can't find the nickname "夜" in NA as well. It is also found on OPGG (https://na.op.gg/summoners/na/%E5%A4%9C) but impossible to find it using the Riot api (with R4J and by hand) this time.

I don't know where the problem could come from, maybe you have an idea?

Thank you for your help !

Missing field in MatchParticipant class.

hi @stelar7 !

I think missing field in lol match v5 api response.
This is "challenges" field in Match Participant.

{
  ...
  "challenges": {
                "12AssistStreakCount": 0,
                "abilityUses": 168,
                "acesBefore15Minutes": 0,
                "alliedJungleMonsterKills": 0,
                "baronTakedowns": 0,
                "blastConeOppositeOpponentCount": 0,
                "bountyGold": 0,
                "buffsStolen": 0,
                "completeSupportQuestInTime": 0,
                "controlWardTimeCoverageInRiverOrEnemyHalf": 0.05215168915369436,
                "controlWardsPlaced": 3,
                "damagePerMinute": 529.0015434423793,
                "damageTakenOnTeamPercentage": 0.22122323997443094,
                "dancedWithRiftHerald": 0,
                "deathsByEnemyChamps": 5,
                "dodgeSkillShotsSmallWindow": 39,
                "doubleAces": 0,
                "dragonTakedowns": 0,
                "earlyLaningPhaseGoldExpAdvantage": -0.06373274326324463,
                "effectiveHealAndShielding": 0,
                "elderDragonKillsWithOpposingSoul": 0,
                "elderDragonMultikills": 0,
                "enemyChampionImmobilizations": 35,
                "enemyJungleMonsterKills": 0,
                "epicMonsterKillsNearEnemyJungler": 0,
                "epicMonsterKillsWithin30SecondsOfSpawn": 0,
                "epicMonsterSteals": 0,
                "epicMonsterStolenWithoutSmite": 0,
                "flawlessAces": 0,
                "fullTeamTakedown": 0,
                "gameLength": 1614.2859992416377,
                "getTakedownsInAllLanesEarlyJungleAsLaner": 0,
                "goldPerMinute": 338.45626803455053,
                "hadAfkTeammate": 0,
                "hadOpenNexus": 0,
                "highestCrowdControlScore": 1,
                "immobilizeAndKillWithAlly": 3,
                "initialBuffCount": 0,
                "initialCrabCount": 0,
                "jungleCsBefore10Minutes": 0,
                "junglerTakedownsNearDamagedEpicMonster": 0,
                "kTurretsDestroyedBeforePlatesFall": 0,
                "kda": 1.6,
                "killAfterHiddenWithAlly": 1,
                "killParticipation": 0.2,
                "killedChampTookFullTeamDamageSurvived": 0,
                "killsNearEnemyTurret": 1,
                "killsOnOtherLanesEarlyJungleAsLaner": 0,
                "killsOnRecentlyHealedByAramPack": 0,
                "killsUnderOwnTurret": 0,
                "killsWithHelpFromEpicMonster": 0,
                "knockEnemyIntoTeamAndKill": 2,
                "landSkillShotsEarlyGame": 3,
                "laneMinionsFirst10Minutes": 68,
                "laningPhaseGoldExpAdvantage": -0.08101105690002441,
                "legendaryCount": 0,
                "lostAnInhibitor": 0,
                "maxCsAdvantageOnLaneOpponent": 5,
                "maxKillDeficit": 0,
                "maxLevelLeadLaneOpponent": 1,
                "moreEnemyJungleThanOpponent": -102.00000002980232,
                "multiKillOneSpell": 0,
                "multiTurretRiftHeraldCount": 0,
                "multikills": 0,
                "multikillsAfterAggressiveFlash": 0,
                "mythicItemUsed": 6662,
                "outerTurretExecutesBefore10Minutes": 0,
                "outnumberedKills": 0,
                "outnumberedNexusKill": 0,
                "perfectDragonSoulsTaken": 0,
                "perfectGame": 0,
                "pickKillWithAlly": 7,
                "poroExplosions": 0,
                "quickCleanse": 0,
                "quickFirstTurret": 0,
                "quickSoloKills": 0,
                "riftHeraldTakedowns": 0,
                "saveAllyFromDeath": 0,
                "scuttleCrabKills": 0,
                "skillshotsDodged": 9,
                "skillshotsHit": 25,
                "snowballsHit": 0,
                "soloBaronKills": 0,
                "soloKills": 0,
                "soloTurretsLategame": 1,
                "stealthWardsPlaced": 3,
                "survivedSingleDigitHpCount": 0,
                "survivedThreeImmobilizesInFight": 6,
                "takedownOnFirstTurret": 0,
                "takedowns": 8,
                "takedownsAfterGainingLevelAdvantage": 0,
                "takedownsBeforeJungleMinionSpawn": 0,
                "takedownsFirst25Minutes": 7,
                "takedownsInAlcove": 0,
                "takedownsInEnemyFountain": 0,
                "teamBaronKills": 0,
                "teamDamagePercentage": 0.2184990967612713,
                "teamElderDragonKills": 0,
                "teamRiftHeraldKills": 0,
                "threeWardsOneSweeperCount": 0,
                "tookLargeDamageSurvived": 0,
                "turretPlatesTaken": 2,
                "turretTakedowns": 1,
                "turretsTakenWithRiftHerald": 0,
                "twentyMinionsIn3SecondsCount": 0,
                "unseenRecalls": 0,
                "visionScoreAdvantageLaneOpponent": 1.0371013879776,
                "visionScorePerMinute": 0.7207488146496799,
                "wardTakedowns": 5,
                "wardTakedownsBefore20M": 2,
                "wardsGuarded": 0
            }
  ...
}

Could you implement this field?
Thanks.

Match-V5

Hi everybody

I wanted to know if I could use this library to recover the champions of each game from summonner. I have access to match-v5 and I wanted to know if this library is compatible.

Thank you very much.

Gson has previously Deserialized to Double

https://github.com/stelar7/L4J8/blob/07d84d58c301c273f9e9d37b42b32c4ceb440156/src/main/java/no/stelar7/api/l4j8/pojo/shared/BaseSpellData.java#L169

Does this work for you when called by way of a StaticChampion? It doesn't work for me, but I'm calling it from Kotlin. I don't think that should be an issue, but I felt I should mention it just in case. Something like what's happening here: https://stackoverflow.com/questions/15507997/how-to-prevent-gson-from-expressing-integers-as-floats.

Fixing ImageAPI.getSplashArt() methods

When retrieving splash art images from DDragon, the version of the game is not needed, the image suffix is .jpg rather than .png, and the StaticChampion.getKey() field is used as a prefix to the skin number. To fix this issue:

Within ImageAPI I've added a new method buildSplashImageURL():

private String buildSplashImageURL(String file)
    {
        Realm  realm         = DDragonAPI.getInstance().getRealm();
        String cdn           = realm.getCDN();

        String preReplace = cdn + Constants.SEPARATOR  + "img/champion/splash" + Constants.SEPARATOR + file;
        return preReplace.replace(" ", "%20");
    }

I've then amended both the pre-existing getSplashArt() methods:

public String getSplashArt(String championKey, int skinNum)
{
        // http://ddragon.leagueoflegends.com/cdn/img/champion/splash/Aatrox_0.jpg
        return buildSplashImageURL(championKey + "_" + skinNum + ".jpg");
}
public String getSplashArt(String championKey, Skin skin)
{
        // http://ddragon.leagueoflegends.com/cdn/img/champion/splash/Aatrox_0.jpg
        return buildSplashImageURL(championKey + "_" + skin.getNum() + ".jpg");
}

This will now return the splash art for a given champion's skin in the correct format, e.g:

https://ddragon.leagueoflegends.com/cdn/img/champion/splash/Gnar_0.jpg

whereas before it was returning it in this format:

https://ddragon.leagueoflegends.com/cdn/13.11.1/img/champion/splash/150_0.png (where 150 is the champion ID)
or
https://ddragon.leagueoflegends.com/cdn/13.11.1/img/champion/splash/150000_0.png (where 150000 is the skin ID)

The file system cache is not removing files properly

Would be great to have this option available. I've found that the file system cache slowly eats up disk space and I have to intermittently clear it out (TTL of 1 day doesn't seem to actually clean up the fs).

Cache configuration

Hi,
i started to use your library and I would like to manage caching configuration, but I didn't find anything. Is it possible to set for how much time to keep some data (both in memory and on disk)?

Method getMatchList from Valorant api not being deserialized properly

Problem

I'm using the latest version 2.1.4.

Currently, the method getMatchList from VALMatchAPI is returning a List<MatchReference>, and all entries in the list are not deserialized properly. The entity MatchReference has the following attributes:

public class MatchReference implements Serializable
{    
    private String matchId;
    private Long   gameStartTime;
    private String teamId;
   ....
}

But the Valorant API from Riot returns the following attributes:

{
    "matchId": "20ae16ff-45d3-1234-b7bd-6d185fd77ba3",
    "gameStartTimeMillis": 1646476634080,
    "queueId": "competitive"
}

Solution

Rename the attributes of the MatchReference entity to the following ones:

public class MatchReference implements Serializable
{    
    private String matchId;
    private Long   gameStartTimeMillis;
    private String queueId;
   ....
}

Do logging using logging facade

Currently logging is done by printing to System.err.

I'd recommend transitioning to a logging facade to make it easier for users of your API to log and trace your logging output. This has been discussed on StackOverflow.

I'd suggest you use SLF4J.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.