-
Notifications
You must be signed in to change notification settings - Fork 143
Refactor #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
asbjornvad
wants to merge
40
commits into
BenFradet:develop
Choose a base branch
from
asbjornvad:refactor
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Refactor #729
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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].
Needs cleanup
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.
… 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...
… them. Use the Builder class to build.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!