Skip to content

feat: 载体启用入口抬到契约 3 - #45

Merged
residua1 merged 1 commit into
mainfrom
feat/carrier-enable-signal
Nov 26, 2026
Merged

residua1 merged 1 commit into
mainfrom
feat/carrier-enable-signal

Conversation

@residua1

Copy link
Copy Markdown
Contributor

Summary

入口表新增 CarrierEnabled,载体插件被父级启用时由原生侧调用,引发 CarrierEnableSignal。

FX-0067 定下这条:Endstone 的插件启用顺序按插入序,载体在自己的 onLoad 里发起嵌套轮、最后入列,子插件的 OnEnable 永远先跑,那时 registerEvent 与 addTask 全被拒。载体声明 load = Startup 把启用方向掰正;停用方向掰不动(disablePlugins() 按插入序反向),由载体 onDisable 的 StopUnderParent 自回收兜住。

宿主契约 2 → 3。顺带把 EventBus 的定时器回调 Fire 改名 Raise(事件用 raise)。

Verification

  • 宿主断言 98 条全过
  • 真机:改前 20 轮 5 败,改后 20 轮无诊断全绿
  • 停用序 hosihikari → capability_smoke → hosihikari_csharp 正确,无 CLR assert

依赖 PluginAbstractions#27(信号类)。

入口表新增 CarrierEnabled,载体插件被父级启用时由原生侧调用,引发
CarrierEnableSignal。Endstone 在调 onEnable 之前就置了 enabled,能力层的闸门
等到这一刻才放开,才能赶在子插件的 OnEnable 之前挂上监听与调度器。

顺带把 EventBus 的定时器回调统一叫 Raise(事件用 raise)。
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T01:39:45.480619Z 9f5d260 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f5d2605ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/NativeHostingEntry.cs
}
catch (Exception ex)
{
s_loggerFactory?.CreateLogger("Hosihikari").LogError(ex, "启用信号分发失败");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Localize the carrier-enable failure diagnostic

If a carrier-enable signal handler throws, this catch block emits a hard-coded Chinese diagnostic even on English or other non-Chinese servers, bypassing the existing UI-culture lookup and neutral English fallback. Add a resource key to CoreStrings.resx and CoreStrings.zh.resx and log it through CoreText.Get, as the other native-entry failure paths do. This violates the operator-message localization invariant in AGENTS.md.

AGENTS.md reference: AGENTS.md:L34-L35

Useful? React with 👍 / 👎.

@residua1
residua1 merged commit e41d8ca into main Nov 26, 2026
5 checks passed
@residua1
residua1 deleted the feat/carrier-enable-signal branch November 26, 2026 01:46
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