RiotSharp 2.0 released

September 25, 2014 - RiotSharp, release

We are pleased to announce the second version of RiotSharp, our C# wrapper for the Riot Games API. In this post, I will detail the changes made to the wrapper.

Tweak to the entry point of the wrapper

We have made a change to how you get a reference to the RiotApi. If you do not own a production API key, you will have to proceed like so:

var api = RiotApi.GetInstance("yourApiKey");

However, if you own a production API key, you will have to specify your rate limits:

var api = RiotApi.GetInstance("yourApiKey", 10sRateLimit, 10mRateLimit);

Removals of the teams v2.2 and leagues v2.3 endpoints

Since it has been more than 2 months since the teams v2.2 and leagues v2.3 endpoints were deprecated, they have been disabled and, consequently, the methods linked to those endpoints have been removed.

The concerned methods are:

Deprecations of the teams v2.3 and leagues v2.4 endpoints

With the releases of the new teams v2.4 and leagues v2.5 endpoints the previous endpoints were deprecated (teams v2.3 and leagues v2.4).

As a result, a few methods were renamed:

If you still want to use the deprecated endpoints, you will have to use those methods.

New teams v2.4 and leagues v2.5 endpoints

If you want access to those new endpoints, you will have to use the following renewed methods:

New match and matchHistory endpoints

Thanks to the match endpoint, you will be able to retrieve information about a match with its id, the signatures of the new methods are:

MatchDetail GetMatch(Region region, long matchId, bool includeTimeline = false);

MatchDetail GetMatchAsync(Region region, long matchId,
    bool includeTimeline = false);

The MatchDetail object will contain various information such as the map on which the match took place, the participants, etc.

Additionally, you are able to retrieve timeline data with the includeTimeline parameter. If you choose to retrieve the timeline you will be able to see the different events and at which point they occured during the game.

There is also a new matchHistory endpoint:

PlayerHistory GetMatchHistory(Region region, long summonerId,
    int beginIndex = 0, int endIndex = 14,
    List<int> championIds = null,
    List<Queue> rankedQueus = null);

PlayerHistory GetMatchHistoryAsync(Region region, long summonerId,
    int beginIndex = 0, int endIndex = 14,
    List<int> championIds = null,
    List<Queue> rankedQueues = null);

You will be able to navigate through the history of a player thanks to the beginIndex and endIndex parameters. By default, they will return the last 15 matches for the players (indexed from 0 to 14). Keep in mind that the API will only retrieve 15 matches per call so there is no need to have a endIndex - beginIndex + 1 exceeding 15. For example if you wanted to retrieve the 11th to 25th games but not the first 10:

var history = api.GetMatchHistory(Region.euw, 123456, 11, 25);

You can also filter the matchHistory by champions played with the championIds parameter. If you wanted to get the last 10 Annie matches played by someone:

var history = api.GetMatchHistory(Region.euw, 123456, 0, 9, new List<int>() { 1 });

Moreover, you can choose to only retrieve ranked games with the rankedQueues parameter. As an example, if we wanted to get the last 5 matches in solo queue for a specific summoner:

var history = api.GetMatchHistory(Region.euw, 123456, 0, 4, null,
    new List<Queue>() { Queue.RankedSolo5x5 });

Addition of the realm and versions endpoints

Those endpoints, contained in the lol static data endpoint, have been available for a long time in the API but they were not implemented in the wrapper because I didn’t think they were useful. However, someone recently requested them:

List<string> GetVersions(Region region);

List<string> GetVersionsAsync(Region region);

The versions endpoint returns a list of versions as a list of strings.

Realm GetRealm(Region region);

Real GetRealmAsync(Region region);

You can find information about what is returned by the realm endpoint on the official documentation for the API.

Support and download

As usual, RiotSharp is available through nuget:

PM> Install-Package RiotSharp

If you encounter issues working with the wrapper, log an issue on GitHub.