-
Notifications
You must be signed in to change notification settings - Fork 10
RiotNet Upgrade Path
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.
- The
Region
enum has been removed - use theRiotNet.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 aPlatformId
property (which replaces the oldRegion
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 allRiotClient
constructors (whereasregion
used to be the first parameter).- Note: the
new RiotClient(Region)
constructor is now gone, sinceplatformId
is always the second parameter. IF you used that constructor, you should now useRiotClient.ForPlatform(platformId)
instead.
- Note: the
- 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 initiallynull
(the old default region was NA). Now you must explicitly specify a platformId.
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 useGetMatchListByAccountIdAsync
and specify the ranked queue(s) to build your own stats. -
GetShardsAsync
-> removed: useGetShardDataAsync
instead. -
GetShardStatusAsync
->GetShardDataAsync
-
GetStatsSummaryAsync
-> removed: no replacement. You can use useGetMatchListByAccountIdAsync
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.
These are changes to class names and property names of the data models.
-
AggregatedStats
-> removed: useIRiotClient.GetMatchListByAccountIdAsync()
insatead, and build your own stats. -
ChampionStats
-> removed: useIRiotClient.GetMatchListByAccountIdAsync()
insatead, and build your own stats. -
Game
-> removed: use Match API instead -
League
->LeagueList
-
LeagueEntry
->LeagueItem
orLeaguePosition
-
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: useIRiotClient.GetMatchTimelineAsync()
insatead.
-
-
MatchTeam
-
Winner
->Win
-
-
MatchParticipantStats
-
MagicDamageTaken
->MagicalDamageTaken
-
MinionsKilled
->TotalMinionsKilled
-
Winner
->Win
-
-
Timeline
->MatchTimeline
-
Frame
->MatchFrame
-
Event
->MatchEvent
-
EventType
->Type
(Note: theEventType
property still exists according to Riot's documentation, but it seems like they don't use it anymore. So just useType
.) -
ItemAfter
->AfterId
-
ItemBefore
->BeforeId
-
-
MatchHistorySummary
-> removed: useMatchList
/MatchReference
instead -
MatchReference
-
MatchId
->GameId
-
-
PlayerStatsSummary
-> removed: useIRiotClient.GetMatchListByAccountIdAsync()
insatead, and build your own stats. -
PlayerStatsSummaryList
-> removed: useIRiotClient.GetMatchListByAccountIdAsync()
insatead, and build your own stats. -
RankedStats
-> removed: useIRiotClient.GetMatchListByAccountIdAsync()
insatead, and build your own stats. -
RecentGames
-> removed: useMatchList
instead. -
Region
->string
(usePlatformId
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 - theStaticItem
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 - theStaticRune
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.
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!
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
.