generated from JustArchiNET/ASF-PluginTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve ASF-FreeGames: JSON serialization, error handling, and HttpClient optimizations #85
Merged
Conversation
This file contains 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
This commit introduces proxy support for Reddit requests within the ASFFreeGames plugin, addressing issues #75 #76. Users can now configure proxies for both general and Reddit-specific connections through the Proxy and RedditProxy settings in ASFFreeGamesOptions.cs. Key changes: - ASFFreeGamesOptions.cs: Added properties Proxy and RedditProxy to support proxy configuration for general and Reddit connections respectively. - ASFFreeGamesOptionsLoader.cs: Updated to load proxy settings from configuration and environment variables. - FreeGamesCommand.cs: Modified GetGames to utilize SimpleHttpClientFactory and its CreateForReddit method, enabling the use of the configured Reddit proxy. - RedditHelper.cs: Replaced WebBrowser usage with SimpleHttpClient for Reddit communication, allowing proxy support. These improvements enhance the plugin's flexibility by allowing users to leverage proxy servers for Reddit interactions.
…limiting from Reddit. * Added checks for remaining rate limit and reset time to implement appropriate delays based on Reddit's response headers.
GetStreamAsync() internal request object use configured http version
…ent optimizations (#84, improvements) This commit addresses several improvements and bug fixes for the ASF-FreeGames plugin: * Fixed JSON serialization issue: * Resolved compatibility problems with recent ASF versions causing issues with `config.json` loading (`ASFFreeGamesOptionsSaver.cs`). * Implemented a new `SaveOptions` method that validates and writes configuration options to the file in a more robust way. * Added unit tests to ensure proper JSON serialization (`ASFFreeGamesOptionsSaverTests.cs`). * Enhanced error handling: * Improved error message when encountering issues during `config.json` loading (`ASFFreeGames.cs`). * Provided more informative logging in case of unexpected errors (`ASFFreeGamesOptionsLoader.cs`). * Optimized HttpClient usage: * Introduced `SimpleHttpClient` class with improved configuration options (`SimpleHttpClient.cs`). * Set default `MaxConnectionsPerServer` to limit resource usage (`SimpleHttpClient.cs`). * Implemented a workaround for missing `CheckCertificateRevocationList` property (`SimpleHttpClient.cs`). * Improved stream handling in `HttpStreamResponse` class to gracefully handle potential null streams (`SimpleHttpClient.cs`, `HttpStreamResponse.cs`). * Minor improvements: * Added comments and code formatting for better readability. * Updated code to adhere to modern C# practices. These changes ensure compatibility with recent ASF versions, provide better error handling for configuration issues, and optimize the performance and reliability of the plugin's network communication.
before merging need #77 to be completed |
merging this will merge #77 also |
Thank you maxisoft! I was really looking forward to this update :) Is it possible to use user:pass proxies? If yes, on what format?
|
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 pull request addresses several key areas to enhance the ASF-FreeGames plugin:
config.json
handling.SimpleHttpClient
for better network performance and handles potential issues gracefully.Specific changes include:
config.json
loading (ASFFreeGamesOptionsSaver.cs
).SaveOptions
method that validates and writes configuration options to the file in a more independant way.ASFFreeGamesOptionsSaverTests.cs
).config.json
loading (ASFFreeGames.cs
).ASFFreeGamesOptionsLoader.cs
).SimpleHttpClient
class with improved configuration options (SimpleHttpClient.cs
).MaxConnectionsPerServer
to limit resource usage (SimpleHttpClient.cs
).CheckCertificateRevocationList
property in older .NET versions (SimpleHttpClient.cs
).HttpStreamResponse
class to gracefully handle potential null streams (SimpleHttpClient.cs
,HttpStreamResponse.cs
).TO-DOs:
These changes contribute to a more stable, efficient, and user-friendly ASF-FreeGames plugin.