Skip to content
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

[+]: IgnoreProxy #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[+]: IgnoreProxy #27

wants to merge 1 commit into from

Conversation

Becods
Copy link
Contributor

@Becods Becods commented Feb 3, 2025

忽略系统代理,修复开着代理会导致卡title的问题

Summary by Sourcery

在发出 HTTP 请求时忽略系统代理。

新功能:

  • 添加了忽略系统代理的配置选项。

Bug 修复:

  • 修复了启用代理可能导致标题冻结的问题。
Original summary in English

Summary by Sourcery

Ignore the system proxy when making HTTP requests.

New Features:

  • Added a config option to ignore system proxy.

Bug Fixes:

  • Fixed an issue where enabling a proxy could cause title freezes.

Copy link

sourcery-ai bot commented Feb 3, 2025

审阅者指南 by Sourcery

此拉取请求引入了一个忽略系统代理设置的修复,解决了在启用代理时游戏在标题屏幕冻结的问题。这是通过在 NetHttpClient 中将代理设置为 null 来实现的。

NetHttpClient 中代理处理的序列图

sequenceDiagram
    participant Game
    participant NetHttpClient
    participant HttpWebRequest

Game->>NetHttpClient: Create()
NetHttpClient->>HttpWebRequest: Create request
Note right of HttpWebRequest: Before: Uses system proxy
NetHttpClient->>HttpWebRequest: Set Proxy = null
Note right of HttpWebRequest: After: Ignores system proxy
Loading

显示 Common 类修改的类图

classDiagram
    class Common {
        -static bool ignoreProxy
        +IgnoreProxy(NetHttpClient) void
    }
    class NetHttpClient {
        -HttpWebRequest _request
        +Create()
    }
    Common ..> NetHttpClient : patches
    note for Common "Added ignoreProxy config and patch method"
Loading

文件级更改

更改 详情 文件
添加了忽略系统代理设置的配置选项,并实现了在 NetHttpClient 中将代理设置为 null 的补丁。
  • 添加了 ignoreProxy 配置条目。
  • NetHttpClient.Create 方法添加了 Harmony 后缀补丁。
  • 补丁从 NetHttpClient 实例中检索 HttpWebRequest
  • 如果启用了 ignoreProxy 配置,补丁将 HttpWebRequestProxy 属性设置为 null。
AquaMai.Mods/Fix/Common.cs

提示和命令

与 Sourcery 交互

  • 触发新审阅: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub 问题: 通过回复审阅评论要求 Sourcery 创建问题。您也可以用 @sourcery-ai issue 回复审阅评论来创建问题。
  • 生成拉取请求标题: 在拉取请求标题的任何位置写 @sourcery-ai 以随时生成标题。您也可以在拉取请求中评论 @sourcery-ai title 以随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任何位置写 @sourcery-ai summary 以随时生成 PR 摘要。您也可以在拉取请求中评论 @sourcery-ai summary 以随时(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide 以随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve 以解决所有 Sourcery 评论。如果您已经处理了所有评论,这很有用。
  • 取消所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss 以取消所有现有的 Sourcery 审阅。特别适用于想要重新开始审阅的情况 - 别忘了评论 @sourcery-ai review 以触发新审阅!
  • 为问题生成行动计划: 在问题中评论 @sourcery-ai plan 以生成问题的行动计划。

自定义您的体验

访问您的仪表板以:

  • 启用或禁用审阅功能,如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide by Sourcery

This pull request introduces a fix to ignore system proxy settings, which resolves an issue where the game would freeze at the title screen when a proxy is enabled. This is achieved by setting the proxy to null in the NetHttpClient.

Sequence diagram for proxy handling in NetHttpClient

sequenceDiagram
    participant Game
    participant NetHttpClient
    participant HttpWebRequest

Game->>NetHttpClient: Create()
NetHttpClient->>HttpWebRequest: Create request
Note right of HttpWebRequest: Before: Uses system proxy
NetHttpClient->>HttpWebRequest: Set Proxy = null
Note right of HttpWebRequest: After: Ignores system proxy
Loading

Class diagram showing Common class modifications

classDiagram
    class Common {
        -static bool ignoreProxy
        +IgnoreProxy(NetHttpClient) void
    }
    class NetHttpClient {
        -HttpWebRequest _request
        +Create()
    }
    Common ..> NetHttpClient : patches
    note for Common "Added ignoreProxy config and patch method"
Loading

File-Level Changes

Change Details Files
Added a configuration option to ignore system proxy settings and implemented a patch to set the proxy to null in NetHttpClient.
  • Added a ignoreProxy configuration entry.
  • Added a Harmony postfix patch to the NetHttpClient.Create method.
  • The patch retrieves the HttpWebRequest from the NetHttpClient instance.
  • The patch sets the Proxy property of the HttpWebRequest to null if the ignoreProxy config is enabled.
AquaMai.Mods/Fix/Common.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Becods - 我已经审查了你的更改 - 以下是一些反馈:

整体评论

  • 请提供英文提交消息,并添加文档注释,解释代理问题以及为什么需要这个更改。
以下是我在审查期间查看的内容
  • 🟢 一般性问题:一切看起来都很好
  • 🟢 安全性:一切看起来都很好
  • 🟢 测试:一切看起来都很好
  • 🟢 复杂性:一切看起来都很好
  • 🟢 文档:一切看起来都很好

Sourcery 对开源项目是免费的 - 如果你喜欢我们的评论,请考虑分享 ✨
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我将使用这些反馈来改进你的评论。
Original comment in English

Hey @Becods - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please provide an English commit message and add documentation comments explaining the proxy issue and why this change is necessary.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@clansty
Copy link
Contributor

clansty commented Feb 3, 2025

其实卡 title 更大可能应该是 poweron 的时候没 poweron 上
但是 poweron 是 amdaemon 和 segatools 管的

@clansty
Copy link
Contributor

clansty commented Feb 3, 2025

然后我觉得这个应该做成一个单独可以开关的选项并且支持自定义代理

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