Skip to content

RiotNet Upgrade Path

AJ Richardson edited this page Jun 4, 2017 · 3 revisions

If you're upgrading from RiotNet v3 or earlier to v4, you will likely run into some breaking changes. This page shows what changed so you can easily upgrade your code to v4.

General Changes

  • The Region enum has been removed - use the RiotNet.PlatformId string constants instead. Platform ID is passed as a string, so if Riot introduces a new platform, you can implement it in your app without requiring a RiotNet upgrade.
  • You can now pass platformId to any API call. You don't need to create a separate RiotClient for each platform anymore. RiotClient still has a PlatformId property (which replaces the old Region property), but it is treated as more of a default.
  • Since platformId is now treated as more of a default, it is the second parameter in all RiotClient constructors (whereas region used to be the first parameter).
    • Note: the new RiotClient(Region) constructor is now gone, since platformId is always the second parameter. IF you used that constructor, you should now use RiotClient.ForPlatform(platformId) instead.
  • The majority of enums have been converted to strings with constants, for the same reason as PlatformId. The constants are all static classes with the same names as the old enums.
  • DefaultPlatformId is now initially null (the old default region was NA). Now you must explicitly specify a platformId.

Method Changes

These are changes to API method names.

  • GetCurrentGameBySummonerIdAsync -> GetActiveGameBySummonerIdAsync
  • GetGamesBySummonerIdAsync -> GetRecentMatchListByAccountIdAsync (Note: account ID is NOT summoner ID. Use one of the Summoner API methods to get the account ID.)
  • GetLeaguesBySummonerIdsAsync -> GetLeaguesBySummonerIdAsync
  • GetLeagueEntriesBySummonerIdAsync -> GetLeaguePositionsBySummonerIdAsync
  • GetMatchAsync (with timeline) -> GetMatchTimelineAsync
  • GetMatchListAsync -> GetMatchListByAccountIdAsync
  • GetRankedStatsAsync -> removed: no replacement. You can use use GetMatchListByAccountIdAsync and specify the ranked queue(s) to build your own stats.
  • GetShardsAsync -> removed: use GetShardDataAsync instead.
  • GetShardStatusAsync -> GetShardDataAsync
  • GetStatsSummaryAsync -> removed: no replacement. You can use use GetMatchListByAccountIdAsync to build your own stats.
  • GetSummonerMasteriesBySummonerIdsAsync -> GetMasteriesBySummonerIdAsync
  • GetSummonerNamesBySummonerIdsAsync -> GetSummonerBySummonerIdAsync
  • GetSummonerRunesBySummonerIdsAsync -> GetRunesBySummonerIdAsync
  • GetSummonersBySummonerIdsAsync -> GetSummonerBySummonerIdAsync
  • GetSummonersBySummonerNamesAsync -> GetSummonerBySummonerNameAsync
  • GetTeamsBySummonerIdsAsync -> removed: no replacement. Teams are no longer a thing.
  • GetTeamsByTeamIdsAsync -> removed: no replacement. Teams are no longer a thing.

Data Model Changes

These are changes to class names and property names of the data models.

  • AggregatedStats -> removed: use IRiotClient.GetMatchListByAccountIdAsync() insatead, and build your own stats.
  • ChampionStats -> removed: use IRiotClient.GetMatchListByAccountIdAsync() insatead, and build your own stats.
  • Game -> removed: use Match API instead
  • League -> LeagueList
  • LeagueEntry -> LeagueItem or LeaguePosition
    • Division -> Rank
    • IsFreshBlood -> FreshBlood
    • IsHotStreak -> HotStreak
    • IsInactive -> Inactive
    • IsVeteran -> Veteran
  • MatchDetail -> Match
    • MatchId -> GameId
    • MatchCreation -> GameCreation
    • MatchDuration -> GameDuration
    • MatchMode -> GameMode
    • MatchType -> GameType
    • MatchVersion -> GameVersion
    • QueueType -> QueueId
    • Region -> PlatformId
    • Season -> SeasonId
    • Timeline -> removed: use IRiotClient.GetMatchTimelineAsync() insatead.
  • MatchTeam
    • Winner -> Win
  • MatchParticipantStats
    • MagicDamageTaken -> MagicalDamageTaken
    • MinionsKilled -> TotalMinionsKilled
    • Winner -> Win
  • Timeline -> MatchTimeline
  • Frame -> MatchFrame
  • Event -> MatchEvent
    • EventType -> Type (Note: the EventType property still exists according to Riot's documentation, but it seems like they don't use it anymore. So just use Type.)
    • ItemAfter -> AfterId
    • ItemBefore -> BeforeId
  • MatchHistorySummary -> removed: use MatchList/MatchReference instead
  • MatchReference
    • MatchId -> GameId
  • PlayerStatsSummary -> removed: use IRiotClient.GetMatchListByAccountIdAsync() insatead, and build your own stats.
  • PlayerStatsSummaryList -> removed: use IRiotClient.GetMatchListByAccountIdAsync() insatead, and build your own stats.
  • RankedStats -> removed: use IRiotClient.GetMatchListByAccountIdAsync() insatead, and build your own stats.
  • RecentGames -> removed: use MatchList instead.
  • Region -> string (use PlatformId constants)
  • Roster -> removed: no replacement. Teams are no longer a thing.
  • Shard -> ShardStatus
  • StaticItemList
    • Basic -> removed: this property is no longer part of the API. You don't need it anyways - the StaticItem properties have default values equal to the old Basic values.
  • StaticRuneList
    • Basic -> removed: this property is no longer part of the API. You don't need it anyways - the StaticRune properties have default values equal to the old Basic values.
  • Team -> removed: no replacement. Teams are no longer a thing.
  • TeamMemberInfo -> removed: no replacement. Teams are no longer a thing.
  • TeamStatDetail -> removed: no replacement. Teams are no longer a thing.

Database changes

If you were storing the RiotNet models in your database, unfortunately your DB upgrade will be a manual process. If you create an open source tool to do the upgrade, please share so I can link to it here!

Upgrading From v1/v2

If you're upgrading from v1/v2, all of the synchronous API calls have been removed. If your code must be synchronous, you can use the Task.Result property to make the asynchronous calls become synchronous, e.g. riotClient.GetSummonerBySummonerNameAsync(name).Result. However, it is strongly recommended to write asynchronous code using async/await or Task.ContinueWith().

Also, there is no longer any dependency on RestSharp.