Giter Club home page Giter Club logo

riot-api-java's People

Contributors

bloc97 avatar brunocf avatar dschow avatar fkunstner avatar friesischscott avatar haakjvork avatar jitpack-io avatar kooner avatar linnun avatar lsinquin avatar manuvaldes avatar ryanhaveson avatar taycaldwell avatar taylorcaldwell 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

riot-api-java's Issues

Can i add ChampData multiple parameter?

I love this project!

When i request "getDataChampion" , i dont know how to add multiple parameter
ChampData.ALL is so large size.

Riot api allow multiple parameter ChampData. ex) ChampData.Spell, ChampData.Passive

Can i?

Would Like To Contribute

Hi there,

Professional Java developer here. I have my own implementation of Riot's API and I'm wondering if we can merge codebases. I think the thing that I can bring immediately is my RiotApiThrottle class which implements rate controls for production and development API keys.

I also have things structured a lot differently, notably using factories to create RiotApi instances (allows flexibility when Riot releases new API versions at the cost of code complexity). Still there's obviously a lot of overlap and I think collaboration is a great tool for community projects like this.

I have also written JUnit tests for every single method and most parameter permutations available. I think the next thing I'm going to care about is some sort of caching / persistence module. I'm doing most of my work with Android apps in mind, though nothing I've currently developed is specific to Android. I plan to leave the caching module flexible enough to be platform agnostic and provide default implementations for Java and Android (Android will be easy since they already support SQLite so closely).

Finally, I understand this isn't an "issue" per se, but I don't have a Twitter and don't want one, so I opted to contact you through this channel.

NullPointerException can occur when Riot API has issues

java.lang.NullPointerException
at main.java.riotapi.RiotApi.getSummonerByName(RiotApi.java:888)

This should probably be prevented by checking if the collection is null, and returning a null object rather than trying to iterate it.

Java 7 support?

I started using this library a while ago when Java 7 was still supported and I can't readily move to Java 8. I can't find a discussion of why Java 7 support was dropped and so was wondering if there's interest in me removing the Java 8 requirement? I can make the changes and create a pull request if so.

Inconsistency of championId type

The method ChampionMastery.getChampionId() returns a long type. However, Static.Champion.getDataChampion(...) takes the id as int type (also, field could be name championId for clarity). I don't know if other differences like that exists elsewhere in the API.

Games ordered by time

I realised the games are returnes in a Set, not a List. Thus, they are not ordered.

Is there a way to get them ordered or do we have do it ourselfs ?

Thank you.

Problem with rune Image NullPointerException

I have a problem with accessing the image of x rune. Using this code:

for (int i : mapIdRunes.keySet()){
                    try{
                        RuneList listaR = api.getDataRuneList();
                            Rune rune = listaR.getData().get(String.valueOf(i));
                            String path = rune.getImage().getFull();
                        }catch (RiotApiException e){
                            e.printStackTrace();
                        }

This throws a NullPointerException, I've been looking for the problem and I think when you get the json image is null.

getLeagueBySummoner() - getEntries issue

Hi again!

I'm trying to get the summoner's league division, but i am getting many version of the division.
When i run the request on Riot's Web https://euw.api.pvp.net/api/lol/euw/v2.5/league/by-summoner/62128873, 19881488/entry?api_key=<API-KEY>
I am getting the following json:
{"62128873": [{ "queue": "RANKED_SOLO_5x5", "name": "Kennen's Pyromancers", "entries": [{ "leaguePoints": 31, "isFreshBlood": false, "isHotStreak": false, "division": "V", "isInactive": false, "isVeteran": false, "losses": 63, "playerOrTeamName": "vBandiTv", "playerOrTeamId": "62128873", "wins": 40 }], "tier": "BRONZE" }]}

The devision in the above json is right, but when i try to get the division from Java, I am using the following method:
String lDivision = api.getLeagueBySummoner(Region.EUW, api.getSummonerByName(sName).getId()).get(0).getEntries().get(0).getDivision()

The problem is that this method returns a wrong division, and when i run .size() on the .getEntries() i get a size of 100, but on the json above the "entries" list have only 10 objects.

Is that some problem with the method? Or am I doing something wrong?

Thx in advance again!

API request limiter and queue

I've just discovered some limitation in the Riot API, which is that you can be banned temporarily/permanently if you hit the number of requests limit on your API key (I thought they would just say "Forbidden, try later").

I will then have to implement some sort of queue, in which all the API requests will be put before even contacting your library (some kind of proxy).

I was wondering in which measure your library could already implement a queue, with some initial methods to parametrize the user's key limits (X requests per 10s, Y requests per 10m, ...) ? (or even auto-discovery with X-Rate-Limit headers returned by the API).

Riot Update

Hello @taycaldwell ,

I want to know if you are planing to update this great API to latest riot changes?

Riot also create a new operations lol-static-data.

Thank you very much and thanks for your work.

Missing files in Jitpack Release v3.9.0

Hey,
Just for Knowledge, I had some problems when I tried to get the lib (release v3.9.0) by Jitpack. I looks like I'm getting only the Manifest and pom files. All the classes are missing.

I tested with the release v3.8.2 and works fine!

Nice Lib btw. Congratulations!

ChampionSpell DTO missing level tips

It was brought to my attention that the Champion spell DTO doesn't contain level tips.

This is a reminder to fix this when I am near a computer. 👍🏾

createProvider()

Hi, I am working on some project with this api, and I want to try the tournament system.

To create a code I need to create tournament and before it the provider. it asks me for callbackUrl String.

The question is what is the url i need to give there while i am on the testing part?

Thanks in advance!

Gson

Does this api require you to have the gson library?
I keep getting a com/google/gson/JsonSyntaxException, not sure why since i'm new to this.

SummonerMethod#getSummonersById() Error

SummonerMethod:

public static Map<String, Summoner> getSummonersById(String endpoint, String region, String key, long... summonerIds) throws RiotApiException {
return getSummonersByName(endpoint, region, key, Convert.longToString(summonerIds));
}

It is calling getSummonersByName(), it should call getSummonersById().

Static Data

Attempting to use methods such as getSpells() or getTags() on (static data) Champion objects just returns null. However, some methods work, such as getName(). I'm not sure if this is an issue with this library, Riot's API, or myself, but it is preventing me from working on the project I am working on. Thanks!

Android Problem with join

Hello I've been trying to use your Creation but I failed to succeed. I could not even compile it, I don't really know why, didn't know what the error messages meant but there was something wrong with Java I think ( prob because it used jdk8 and not jdk 7 like it is in android studio).

Then I found that there is a Android Version ( https://github.com/rithms/riot-api-java/releases/download/v3.8.2-android/riot-api-java-android.jar ) of this and took that. I'm using minSDK 16 and compileSDK 23. And path to Java: C:\Program Files\Java\jdk1.7.0_79
But now everytime I compile I get this Error:

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: amar.testriotapijar, PID: 24307 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:304) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoSuchMethodError: No static method join(Ljava/lang/CharSequence;[Ljava/lang/CharSequence;)Ljava/lang/String; in class Ljava/lang/String; or its super classes (declaration of 'java.lang.String' appears in /system/framework/core-libart.jar) at net.rithms.riot.api.RiotApi.getSummonersByName(RiotApi.java:1084) at net.rithms.riot.api.RiotApi.getSummonersByName(RiotApi.java:1099) at amar.testriotapijar.MainActivity$FetchSummonerTask.doInBackground(MainActivity.java:91) at amar.testriotapijar.MainActivity$FetchSummonerTask.doInBackground(MainActivity.java:82) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)  at java.lang.Thread.run(Thread.java:818) 

Oh and my Source is this:

`package amar.testriotapijar;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.TextView;

import net.rithms.riot.api.RiotApi;
import net.rithms.riot.api.RiotApiException;
import net.rithms.riot.constant.Region;
import net.rithms.riot.dto.Summoner.Summoner;

import java.util.Map;

public class MainActivity extends AppCompatActivity {
int id =0;
TextView tv;
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
final Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
FetchSummonerTask summonerTask = new FetchSummonerTask();
summonerTask.execute("summoner1");
}
});
fab.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", new View.OnClickListener() {
@OverRide
public void onClick(View v) {

                        }
                    }).show();
        }
    });
}

private int getIDOfSummoner(String summName) throws RiotApiException{


    return 0;
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }

    return super.onOptionsItemSelected(item);
}


public class FetchSummonerTask extends AsyncTask<String, Void, Summoner> {

    @Override
    protected Summoner doInBackground(String... params) {

        RiotApi api = new RiotApi(
                "apikeyhiddenforreasons");
        try {
            api.setRegion(Region.EUW);
            Map<String, Summoner> summoners = api.getSummonersByName(params[0]);
            if(summoners != null) {
                return summoners.get(params[0].replaceAll("\\s+", "").toLowerCase());
            }
        } catch (RiotApiException e) {
            e.printStackTrace();
        }

        return null;
    }

    @Override
    protected void onPostExecute(Summoner result) {
        super.onPostExecute(result);
        if(result != null) {
            TextView dis = (TextView) findViewById(R.id.tv);
            dis.setText(String.valueOf((result.getSummonerLevel())));
        }
    }
}

}
`

Can't get it to work within an Android App

Hello,

I have created a simple Android App with a TextView and a button... Inside the MainActivity and within the onCreate() function i have the listener of the button with the code:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final Button button = (Button) findViewById(R.id.button1);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                RiotApi api = new RiotApi(
                        "API-KEY");

                Map<String, Summoner> summoners = null;
                try {
                    TextView dis;
                    dis = (TextView) findViewById(R.id.textView1);

                    api.setRegion(Region.EUW);
                    summoners = api.getSummonerByName("summoner name");
                    dis.setText((int) summoners.get("summonername").getSummonerLevel());
                } catch (RiotApiException e) { // TODO Auto-generated catch
                                                // block
                    e.printStackTrace();
                }

            }
        });

    }

When i click the button the app crashes... i tested it on a simple java app and it works perfectly... can you explain the issue here?

Regards,
Stergos

Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_65\bin\java.exe'' finished with non-zero exit value 1

Got this email -

Hi man

I am currently working with an older version of the library and it works perfectly, but the newer version released about 25 days ago and the current one prevents me from launching any android project which has it as a dependency. I have recreated this scenario on five different systems and neither of them is able to launch.

The error is as follows:

Error:Execution failed for task ':app:preDexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_65\bin\java.exe'' finished with non-zero exit value 1

After researching the error, it appears there are multiple possible causes. I might’ve been on the wrong track with the aforementioned ‘unused icons’ but I just wanted to inform you of this issue.

Hope it helps and keep up the great work.

Cheers

TODO

Change getSummonerByName() and getSummonerById() methods to return single Summoner object instead of a Map with one entry.

Update the keys of Map<String, Summoner> returned by getSummonersByName() methods to be case-insensitive.

Still adding onto the list, feel free to make suggestions.

How to get the stat for each rune?

Hello,

I am trying to retrieve each stat a rune has("stats": {"FlatMagicDamageMod": 1.19}) etc...

My current code:

             RuneList static_runes = api.getDataRuneList(null, null, RuneListData.STATS);

             Map<String, Rune> runes_data = static_runes.getData();
             for (Entry<String, Rune> rune : runes_data.entrySet()){
                 System.out.println(rune.getValue().getId());
                 System.out.println(rune.getValue().getName());
                 System.out.println(rune.getValue().getDescription());
                 System.out.println(rune.getValue().getRune().getType());
                 System.out.println(rune.getValue().getRune().getTier());
                 System.out.println(rune.getValue().getStats());
                 System.out.println("###########################");
             }

However the getStats() method contains all the stats and i cant find out how to get the stat according to the rune...

API call: https://global.api.pvp.net/api/lol/static-data/euw/v1.2/rune?runeListData=stats&api_key=api_key

RiotApiAsync object is missing

Hi rithms!

I was looking at you'r Async request example, and wanted to try it, the problem is that i dont have a RiotApiAsync object at - net.rithms.riot.api package.
I'v downloaded the latest jar file, and it missing there too.
Is it an object that should be in the jar? Or should I create it by my self?

One more question - I'v already made some project that is working fine, the problem is that i am getting a lot of "Rate limit exceeded" Exceptions. To avoid it I used the Thread.sleep(xxxx) method before every request to riot, is the Async way can help me to avoid the sleep method?

Thx in Advance!

getRegionByName

I don't have this function in my JAR, was it added in the 4.0 version ? As you said I have the 3.9 so I suspect that's the problem. In case it is, is there any link to download it ?

Thank you.

Service unavailable

I am trying to get a champion's static data with my development key:

ApiConfig ac = new ApiConfig();
ac.setKey("MY API KEY");
RiotApi api = new RiotApi(ac);
net.rithms.riot.api.endpoints.static_data.dto.Champion champData = api.getDataChampion(Region.TR, 98);

But I get the following error :

net.rithms.riot.api.RiotApiException: Service unavailable
    at net.rithms.riot.api.request.Request.execute(Request.java:155)
    at net.rithms.riot.api.request.Request.<init>(Request.java:88)
    at net.rithms.riot.api.EndpointManager.callMethodAndReturnDto(EndpointManager.java:57)
    at net.rithms.riot.api.RiotApi.getDataChampion(RiotApi.java:580)
    at net.rithms.riot.api.RiotApi.getDataChampion(RiotApi.java:599)

But when I use Postman, I can get the result and service is available.

What can be the problem ?

API request counter (enhancement idea)

Just thinking, I'm often reaching the API limit with the new app I'm developing. I would think it could be useful, for debug at least, to have metrics about the usage of the API.

I know some API doesn't consume an API call on your account (like static data) and others does. We could have an history in the library allowing the developer to see which methods are called the most and consume the maximum of calls.

It could be a queue emptying the oldest request made. It would of course be activable or not to not consume an overhead of memory if not desired.

AsyncRequest return type should be known at compile time

The current implementation of AsyncRequest#getDto() takes a generic parameter to specify the return type of the method. This makes it impossible to see what asyncRequest.getDto() is actually returning. It could be a summoner, a CurrentGameInfo or anything else. We only know it from looking at the context, but not from the object itself.

Additionally it can lead to runtime exceptions like this:

AsyncRequest req = riotApiAsync.getSummonersByName(Region.EUW, "danijoo");
CurrentGameInfo info = req.getDto(); // compiles fine, but throws a ClassCastException at Runtime

I wonder what led to this design decision. Wouldnt it be more convenient to have a fixed return type with an implementation like this?

class AsyncRequest<T> extends Request<T> {

     // ....

    @Override
    public T getDto() {  
        // ....
    }

}
AsyncRequest<Map<String, Summoner>> req = riotApiAsync.getSummonersByNames(Region.EUW, "danijoo");
CurrentGameInfo info = req.getDto(); // this wont compile because return type does not match.
Map<String, Summoner> summoners = req.getDto(); // this line works

Best Regards,
Daniel

Caching

Introduce an optional caching system, with cache duration configurable.
This would avoid consuming the limited calls for identical repeated queries.

Champion.getName() is returning different names to the ones used in the champion names on ddragon.

I am using this links to get champ icons:
http://ddragon.leagueoflegends.com/cdn/6.3.1/img/champion/[champ_name].png

I have problems with some names (i.e. leblanc, fiddle).The names returned are ot exactly the same, I get Fiddlesticks instead of FiddleSticks and thus I can't load the image. I tried getImage().getFull() from the champion but is returning null.

Since this API is used in other implementations, I guess I should take the name from other place, but I don't where since the getImage() is returning a null object.

Thank you.

QueueType

Edited:
I found my issue, I was using getGameTypeConfigId(), instead of getGameQueueConfigId()
However I was confused because I did not find the first one at rito's docs.


Hello, thanks for your api.

I wonder if you could help me with a tiny issue I have. I'm trying to find the queue type of a match, so I used getGameMode or GetGameType but that wasn't enough (but it worked as it should) so i'm now trying to use:
QueueType.getQueueNameByConfigId( (int) game.getGameTypeConfigId() )

however, game.getGameTypeConfigId() will always return 0, which is "custom" gameType

Maybe I am doing something wrong, in that case let me know and I'll try to figure it out.

Thanks

[Question] Availability on Maven Central ?

Hello,

Do you plan an availability of the library availability on Maven Central to directly import it on new maven projects by simply putting the reference in the POM, and automatically downloaded ?

Thanks,
Regards.

Problem with some field naming (inconsistency, missing setters)

I was digging in the API, and doing some serialization of retrieved data (champion's data) to not always contact the API. But this process fails (in my case, using Jackson) because some fields have a different naming than their getters.

I've stumbled upon this in net.rithms.riot.dto.Static.Stats (from net.rithms.riot.dto.Static.Champion).
Fields are name like 'hpregenperlevel', 'movespeed', etc. when the getters are named getHpRegenPerLevel(), getMoveSpeed(), etc.

This breaks my serialization/deserialization process, but also lacks of consistency.
Also, why not putting some setters with same names than getters? There is no problem of putting setters in a DataObject like this (this could have saved me).

I don't know if other objects are like this.

Thanks,

Validating summoner names

So, there is a thread about validating API calls on the forums.

Most of the stuff discussed, like using the proper DNS for a region and correct platform ID names, the library already enforces.

The one thing we don't really do is validate summoner names before making an API call.

If you have a input field on your site or in your app that lets a user enter a summoner name to lookup, do not blindly pass that value along to the API without first doing some validation. Any request with a name parameter that contains any characters that are not valid for a summoner name, even if they are URL encoded, will return a 403. The full set of allowed characters across Riot, Tencent, and Garena regions includes any visible Unicode letter characters, digits (0-9), spaces, underscores, and periods. Other than that, no punctuation characters are allowed. Thus, the regular expression to use for validating summoner names would be "^[0-9\p{L} _.]+$". You should be rejecting inputs that don't match this regular expression (i.e., that contain any punctuation characters other than periods, underscores, and spaces), rather than sending them to the API.

This change should be as simple as just running summoner names through the regular expression provided. I'm just opening this issue till I get around to doing it.

The import net cannot be resolved

Hi,

I'm not an expert at Java, but I found this problem when using the code:
I set up the jar file as suggested in the readme and used the example code, but an error "The import net cannot be resolved" occurred.

I guess this is probably because there's no "net" folder within the jar file, but only "constant", "dto.xxx", "main.java.riotapi", etc.

I'm not sure if this is my own fault, or if the example usage should be updated. Any suggestion appreciated!

How can we get the placements stats ?

If you try to get the rancked information of a unrancked summoner, even if he has played some placement games it returns nothing.

Is this possible?

Thanks.

Parameter encoding issue

if it call riot api in english, its work
but it shown error in other language

ex:
api.getSummonersByName("카시오가피");
// this is my nick name in korean
output: unauthnized exception

because url is invalid
called URL is http://riot.~~~~~/by-name/카시오가피?api_key=kkkkkkkk.
riot server need /by-name/{{nickname}} and api_key={{kkkkkkk}}
but riot will parse /by-name/{{카시오가피?api_key=kkkkkkkk}} and api_key is null

so it need to adding urlencoding as "UTF-8"
ex:
api.getSummonersByName(URLEncoder.encode("카시오가피", "UTF-8"));

but it not need to encoding when extracting ID
because Map's key have a String without encoded

Summoner summoner = summoners.get("카시오가피");

summary)
If region is allowed local language nick name, you have to use URLEncoder with "UTF-8"
and dont use URLEncoder when extract ID from Summoner MAP

ex)
//below code is works
api.getSummonersByName(URLEncoder.encode("카시오가피", "UTF-8"));
Summoner summoner = summoners.get("카시오가피");
id = Long.toString(summoner.getId());

thanks rithms

[Enhancement] Replace 'String locale' with Locale locale or new internal RiotLocale object

In methods such as Champion getDataChampion(int id, String locale, String version, ChampData... champData), the locale value is a String. Using the library, you don't necessarily know what String to put : "fr", "FR", fr-FR", fr_FR", etc. ?

An improvement of this could be passing a Locale object, and then internally call the toString() conversion method to get 'fr_FR'. But this still leaves us with the problem of a user passing Locale.FRENCH instead of Locale.FRANCE : you'll end up with String 'fr' instead of 'fr_FR' required by the Riot API.

So I think the best alternative is to add your custom RiotLocale enum in your library, that would contains all the locales supported by the API, and change your methods signature to support this instead of String.

=> `Champion getDataChampion(int id, RiotLocale locale, String version, ChampData... champData)

What do you think of this?
Thanks.

Maven: Latest release not available.

It would be awesome to have this library uploaded to jcenter/mavencentral so we can check it out without downloading the jar for every commit.

Best regards,
Daniel

Why no setters/mutators for Dto objects?

Hello,

Quick question why do some classes simply not have setters but do have getters?

As far as I understand it this breaks with convention for Dto and POJO's. Also this makes it extremely hard to implement any kind of persistence or caching and creates extra requests through the api. See wikipedia entry about Data Transfer Object's

Data transfer object (DTO), formerly known as value objects or VO, is a design pattern used to transfer data between software application subsystems. DTOs are often used in conjunction with data access objects to retrieve data from a database.

The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behaviour except for storage and retrieval of its own data (accessors and mutators).

In a traditional EJB architecture, DTOs serve dual purposes: first, they work around the problem that entity beans are not serializable; second, they implicitly define an assembly phase where all data to be used by the view is fetched and marshalled into the DTOs before returning control to the presentation tier.

So for example to create a DAO implementation of Summoner I would have to be able to restore that object from the database using either a loaded constructor or setter methods.

Please correct me if I'm wrong as I have not used this api before and if there is an alternative please let me know. Otherwise please let me know what you think about adding setters to such methods.

getMatchList with fewer paramaters

Hi,

Looking at the Riot API Reference I should be able to get a MatchList using {Region,Summoner ID, RankedQueues} or {Region,Summoner ID, RankedQueues, Season} (along with a few other combinations) but you only have it implemented for the following parameter combinations:

(Region ,summonerId, championIds, rankedQueues, seasons, beginTime, endTime, beginIndex, endIndex)
(Region , summonerId)
(summonerId, championIds, rankedQueues, seasons, beginTime, endTime, beginIndex, endIndex)
(summonerId)

Is it the implementation or my lack of knowledge that's hindering me here?

THANKS FOR THE (otherwise) AWESOME LIBRARY

Cheers

Create the javadoc and show in gh-pages

Hi,
It would be nice to create the javadoc and put into the branch gh-pages.
if you put the javadoc into a branch called gh-pages the github will publish your static files for free.
A sample for the folders, you could delete all the classes in the gh-pages branch and add the javadoc into a folder called gh-pages in your master branch.

-gh-pages
-examples
-src
LICENSE.txt
README.md
pom.xml

Advice on Hiding API key

Hello, I've created my first application and I am planning on asking for my production APi key. I wonder if you could tell me some advice on hiding it. I mean, I don't want to invest too much effort in this, but at least some basic protection would be great.
Thanks.

[Enhancement] Adding toString methods

It would be nice if data objects had already overridden toString() methods displaying some key information. Like (id, name, summonerLevel) for class Summoner, (name, tier, queue) for class League, etc.

What do you think?
Thanks.

RiotApi class static methods discussion

I'm thinking of making the RiotApi class methods static. That way you don't need to instantiate an object such as:

RiotApi api = new RiotApi("API-KEY");
Champion champ = getChampionById(1);

instead you can just do:
RiotApi.setKey("API-KEY");
Champion champ = RiotApi.getChampionById(1);

Let me know if this kind of change is something you would like to see, or if you would have a problem with it, and why.

I want to ask for feedback before making changes like this. I know some of you would have to refactor your existing code, but I think it would be for the better.

Let me know!

Rithms

Lots of timeouts on big-scale projects

On big-scaled projects the current master branch (4.0.0 alpha) has a huge amount of read timeouts when using alot of asynchronous requests.

I could not yet figure out why. Doing the same with synchronous requests and wrapping each request in its own thread works fine without read timeouts. (with timeout and asyncTimeout set to the same value of 10000)

This issue is mainly a warning for everyone who plans on using the alpha version in big live environments - but if anyone can find out some hints on why this happens, please let me know.

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.