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 10 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.
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.

1 participant