Skip to content

fix(AutoReset): clean WorldEvent after reset #974#982

Merged
ACaiCat merged 3 commits intomasterfrom
fix-autoreset
Jun 24, 2025
Merged

fix(AutoReset): clean WorldEvent after reset #974#982
ACaiCat merged 3 commits intomasterfrom
fix-autoreset

Conversation

@ACaiCat
Copy link
Copy Markdown
Member

@ACaiCat ACaiCat commented Jun 23, 2025

更新插件/修复BUG

  • 插件已修改版本号
  • 更新插件README.md中的更新日志
  • 插件可以正常工作

其他

  • ❤️熙恩我喜欢你

Sourcery 总结

清理自动重置后的世界事件状态,移除过时的重置提示设置,提升插件版本,并更新更新日志。

Bug 修复:

  • 通过清除入侵规模、元宵夜状态并在重置后停止 DD2Event 来重置世界事件
  • 移除重置后多余的 Utils.CallApi 调用

增强:

  • 移除过时的 CaiBotToken 和 ResetCaution 配置选项
  • 通过删除不必要的权限参数来简化“who”命令注册
  • 重构插件构造函数签名以实现直接依赖注入
  • 简化 TShock.DB.Query 调用签名

文档:

  • 使用 v2024.6.23.0 条目更新 README 更新日志

杂务:

  • 将插件版本提升至 2025.06.23.0
  • 移除已弃用的 Utils.cs 文件
Original summary in English

Summary by Sourcery

Clean up world event states after auto-reset, remove obsolete reset-prompt settings, bump plugin version, and update changelog.

Bug Fixes:

  • Reset world events by clearing invasion size, LanternNight state, and stopping DD2Event after reset
  • Remove redundant Utils.CallApi invocation after reset

Enhancements:

  • Remove obsolete CaiBotToken and ResetCaution configuration options
  • Simplify 'who' command registration by dropping an unnecessary permission argument
  • Refactor plugin constructor signature for direct dependency injection
  • Simplify TShock.DB.Query call signature

Documentation:

  • Update README changelog with v2024.6.23.0 entry

Chores:

  • Bump plugin version to 2025.06.23.0
  • Remove deprecated Utils.cs file

@ACaiCat ACaiCat requested a review from a team June 23, 2025 00:42
@ACaiCat ACaiCat self-assigned this Jun 23, 2025
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Jun 23, 2025

## 审查者指南

此PR确保在重置后完全清理世界事件,移除已弃用的CaiBot重置警告功能,重构插件初始化和命令注册(包括版本升级),并简化数据库查询调用。

#### 移除CaiBot字段后的ResetConfig的ER图

```mermaid
erDiagram
    RESETCONFIG {
        Dictionary Files
        string[] PreResetCommands
        SetWorldConfig SetWorld
    }
    RESETCONFIG ||--|| SETWORLDCONFIG : contains

移除CaiBot字段后的ResetConfig的类图

classDiagram
    class ResetConfig {
        +Dictionary~string, string~? Files
        +string[]? PreResetCommands
        +SetWorldConfig SetWorld
    }
Loading

事件清理和重构后的AutoResetPlugin的类图

classDiagram
    class AutoResetPlugin {
        +string FolderName
        -Status _status
        -GenerationProgress? _generationProgress
        +string Name
        +Version Version
        +string Author
        +void Initialize()
        +void Dispose()
        +void ResetCmd(CommandArgs? e)
        +void ResetDataCmd(CommandArgs? e)
        +void ResetSetting(CommandArgs? e)
        +void OnServerJoin(JoinEventArgs args)
        +void OnWorldSave(SaveEventArgs args)
        +void PostReset()
        +void ShowHelpText()
        +void OnWho(CommandArgs? e)
    }
Loading

文件级别变更

变更 详情 文件
增强了重置逻辑以清除世界事件
  • ResetCmd现在将Main.invasionSize重置为0
  • 调用LanternNight.WorldClear()
  • 停止DD2Event入侵
  • 移除了Utils.CallApi()调用
src/AutoReset/AutoResetPlugin.cs
移除了CaiBot重置警告功能和令牌
  • 删除了CaiBotToken字段
  • 移除了ResetCaution属性
  • 更新了README模式以删除已移除的设置
src/AutoReset/ResetConfig.cs
src/AutoReset/README.md
更新了插件初始化和命令注册
  • 切换到采用Main game的构造函数并添加了ReSharper抑制
  • 调整了'who'命令构造函数以移除空权限
  • 将Version属性升级到2025.06.23.0
src/AutoReset/AutoResetPlugin.cs
简化了数据库查询调用并添加了代码注释
  • 从TShock.DB.Query调用中移除了Array.Empty参数
  • 在switch语句上添加了ReSharper disable注释
src/AutoReset/AutoResetPlugin.cs

可能相关的issue


提示和命令

与Sourcery互动

  • 触发新的审查: 在pull request上评论 @sourcery-ai review
  • 继续讨论: 直接回复Sourcery的审查评论。
  • 从审查评论生成GitHub issue: 通过回复审查评论,要求Sourcery从审查评论创建一个issue。您也可以回复审查评论并使用 @sourcery-ai issue 从中创建一个issue。
  • 生成pull request标题: 在pull request标题中的任何位置写入 @sourcery-ai 以随时生成标题。您也可以在pull request上评论 @sourcery-ai title 以随时(重新)生成标题。
  • 生成pull request摘要: 在pull request正文中的任何位置写入 @sourcery-ai summary 以随时在您想要的位置生成PR摘要。您也可以在pull request上评论 @sourcery-ai summary 以随时(重新)生成摘要。
  • 生成审查者指南: 在pull request上评论 @sourcery-ai guide 以随时(重新)生成审查者指南。
  • 解决所有Sourcery评论: 在pull request上评论 @sourcery-ai resolve 以解决所有Sourcery评论。如果您已经解决了所有评论并且不想再看到它们,这将非常有用。
  • 驳回所有Sourcery审查: 在pull request上评论 @sourcery-ai dismiss 以驳回所有现有的Sourcery审查。如果您想重新开始新的审查,这将特别有用 - 不要忘记评论 @sourcery-ai review 以触发新的审查!

自定义您的体验

访问您的 仪表板 以:

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

获取帮助

```
Original review guide in English

Reviewer's Guide

This PR ensures a full cleanup of world events after a reset, strips out the deprecated CaiBot reset-caution feature, refactors plugin initialization and command registration (including a version bump), and simplifies a database query call.

ER diagram for ResetConfig after CaiBot fields removal

erDiagram
    RESETCONFIG {
        Dictionary Files
        string[] PreResetCommands
        SetWorldConfig SetWorld
    }
    RESETCONFIG ||--|| SETWORLDCONFIG : contains
Loading

Class diagram for ResetConfig after CaiBot fields removal

classDiagram
    class ResetConfig {
        +Dictionary~string, string~? Files
        +string[]? PreResetCommands
        +SetWorldConfig SetWorld
    }
Loading

Class diagram for AutoResetPlugin after event cleanup and refactor

classDiagram
    class AutoResetPlugin {
        +string FolderName
        -Status _status
        -GenerationProgress? _generationProgress
        +string Name
        +Version Version
        +string Author
        +void Initialize()
        +void Dispose()
        +void ResetCmd(CommandArgs? e)
        +void ResetDataCmd(CommandArgs? e)
        +void ResetSetting(CommandArgs? e)
        +void OnServerJoin(JoinEventArgs args)
        +void OnWorldSave(SaveEventArgs args)
        +void PostReset()
        +void ShowHelpText()
        +void OnWho(CommandArgs? e)
    }
Loading

File-Level Changes

Change Details Files
Enhanced reset logic to clear world events
  • ResetCmd now resets Main.invasionSize to 0
  • Invokes LanternNight.WorldClear()
  • Stops DD2Event invasions
  • Removed Utils.CallApi() invocation
src/AutoReset/AutoResetPlugin.cs
Removed CaiBot reset caution feature and tokens
  • Deleted CaiBotToken field
  • Removed ResetCaution property
  • Updated README schema to drop removed settings
src/AutoReset/ResetConfig.cs
src/AutoReset/README.md
Updated plugin initialization and command registration
  • Switched to a constructor taking Main game and added ReSharper suppression
  • Adjusted 'who' command constructor to remove empty permission
  • Bumped Version property to 2025.06.23.0
src/AutoReset/AutoResetPlugin.cs
Simplified database query call and added code annotation
  • Removed Array.Empty parameter from TShock.DB.Query call
  • Added ReSharper disable comment on switch statement
src/AutoReset/AutoResetPlugin.cs

Possibly linked issues


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!

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

@ACaiCat ACaiCat changed the title fix(AutoReset): clean WorldEvent after reset #974 fix(AutoReset): clean WorldEvent after reset UnrealMultiple/TShockPlugin#974 Jun 23, 2025
@ACaiCat ACaiCat changed the title fix(AutoReset): clean WorldEvent after reset UnrealMultiple/TShockPlugin#974 fix(AutoReset): clean WorldEvent after reset #974 Jun 23, 2025
Copy link
Copy Markdown
Contributor

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

@ACaiCat - 我已经查看了你的更改,它们看起来很棒!


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

Hey @ACaiCat - I've reviewed your changes and they look great!


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.

@ACaiCat ACaiCat linked an issue Jun 23, 2025 that may be closed by this pull request
2 tasks
@ACaiCat ACaiCat added this pull request to the merge queue Jun 24, 2025
Merged via the queue into master with commit fe5f9b3 Jun 24, 2025
2 checks passed
@ACaiCat ACaiCat deleted the fix-autoreset branch June 27, 2025 04:35
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.

[BUG] AutoReset未重置事件

2 participants