Skip to content

Conversation

@asbjornvad
Copy link

This is my attempt at refactoring the RiotSharp api wrapper with a more separated approach(and up to date). The goal is that each game, be it LoL, Valorant and LoR, has their own Nuget package, and use the base functionality provided in the Core package.

The very basic stuff as API-ratelimiting is implemented and seems to work. Things like method ratelimiting and caching is not implemented yet, but should be "easy" to add, once done. This branch is NOT ready!!!

The testing is also done in each project, so the Core functionality is tested with no regards to actual implementations.

Please note that this is the work of a software engineering student during sparetime, and there might be better approaches.
I hope that others will see this as a way to get the RiotSharp wrapper back to the top, and will contribute to that goal!

asbjornvad and others added 30 commits June 23, 2024 15:21
All the Newtonsoft is now System.Text.Json.
Some tests pass, some fail because of errors in JsonSerializer.
Starting refactoring of the ratelimiting and httprequesting.
…quester.

Next task is trying to refactor some already working endpoints to work with the new requester.
…pplication ratelimiters use the IRateLimiter Interface since they fulfil the same duty. No base class for neither.
… This is simpler and the thread safety should be provided by the underlying implementation of MemoryCache.

The number of tests are unsatisfactory as of now.
…ot of uncommented code to avoid build errors.
…hanged exception and Lease.

Still needs some more stuff. A util method should be used to create and send requests to reduce code duplication.
Refactored `IRequester` to `IRiotRequester` across the codebase for improved clarity and alignment with Riot API domain-specific terminology. Updated static data endpoints, constructors, and method calls to reflect this change. Removed `summonerId`-based methods in favor of `puuid`, modernizing API usage.

Deprecated the `ChampionMastery` class and related methods, introducing nullable return types and new methods in `IChampionMasteryEndpoint`. Added unit tests for Champion Mastery functionality using `Moq` and `NUnit`.

Enhanced error handling, modularity, and code readability. Introduced `RateLimitedEndpointBase` for centralized rate-limiting and request handling. Updated project dependencies and improved test coverage for reliability.

Appsettings file needs to be added in the test project root with an apikey.
Refactored `IRequester` to `IRiotRequester` across the codebase for improved clarity and alignment with Riot API domain-specific terminology. Updated static data endpoints, constructors, and method calls to reflect this change. Removed `summonerId`-based methods in favor of `puuid`, modernizing API usage.

Deprecated the `ChampionMastery` class and related methods, introducing nullable return types and new methods in `IChampionMasteryEndpoint`. Added unit tests for Champion Mastery functionality using `Moq` and `NUnit`.

Enhanced error handling, modularity, and code readability. Introduced `RateLimitedEndpointBase` for centralized rate-limiting and request handling. Updated project dependencies and improved test coverage for reliability.

Appsettings file needs to be added in the test project root with an apikey.
For every TestFixture that shouldnt be run in CI, add the     [Category("OnlyLocal")]
At [TestFixture].
Updated .gitignore to exclude appsettings.json files in test directories. Removed hardcoded `ApiKey` from appsettings.json to enhance security and prevent sensitive information from being stored in version control.
Introduced Champion Mastery API with new endpoint, interface, and models
to retrieve mastery data, scores, and top champions. Refactored namespaces
to improve organization and updated exception handling for better error
messages. Enhanced test coverage with a new test project targeting .NET 8.0
and added unit tests for Champion Mastery functionality. Adjusted visibility
of JSON converters for external use and updated solution/project files to
support new features.
asbjornvad and others added 24 commits June 21, 2025 21:30
… verify.

Added and removed some Misc multiple places.
The shard and region parts are only strings for now, since the api is fucking stupid and inconsistent...
The shard and region parts are only strings for now, since the api is fucking stupid and inconsistent...
Champion rotation endpoint is basically a copy paste of the old.
It has the implemented Match endpoint but it has no tests as of yet...
A lot of nullable and required fields that might be wrong, the docs are pretty bad at specifying what is and is not in the json. Removed 2 txt files. Updated the Core project to nuget capability. So the Lol and account project references nuget instead of project.
@asbjornvad
Copy link
Author

Notes:

  • Account project should be complete.
  • Core has a working requester and ApplicationRateLimiter. Still needs support for caching, MethodRateLimiter and possibly return of HttpResponse instead of desirialized content. Also needs support for RSO (Riot Sign On?).
  • Most of the LoL endpoints are implemented. However the official documentation is lacking when it comes to which fields are always returned and which are only sometimes. Therefore the "required" and "nullable" properties should be reconsidered. Tests pass, but other calls might fail.
  • I have dabbled with github actions and have two workflows. One that runs on pushes(build and test) and one that runs on created releases(push nuget). Push nuget tests the build to verify, and then pushes the 3 nuget packages to nuget.org(see AV.RiotSharp.Account, Core and LeagueOfLegends).

The overall architecture is differs slightly from the monolithic RiotAPI approach the current RiotSharp project uses.

@BenFradet
Copy link
Owner

thanks 👍 , do you consider the pr ready for review now?

@asbjornvad
Copy link
Author

If the notes above are taken into account then yes.

@asbjornvad asbjornvad marked this pull request as ready for review January 22, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants