Skip to content

[GFX-551] fix(server): 移除 PipelineFilter 默认构造函数限制以支持 DI 构造 - #18

Merged
AlianBlank merged 2 commits into
mainfrom
feature/GFX-551
Aug 6, 2026
Merged

[GFX-551] fix(server): 移除 PipelineFilter 默认构造函数限制以支持 DI 构造#18
AlianBlank merged 2 commits into
mainfrom
feature/GFX-551

Conversation

@AlianBlank

@AlianBlank AlianBlank commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

背景

上游基准:kerryjiang/SuperSocket @ f7cf1f5,对齐上游 e453195(refactor pipeline filter constraints to class type)与 1f4d90b(TPipelineFilter doesn't have to be new())。

改动

将 3 个公共入口的 TPipelineFilter 约束由 'class, IPipelineFilter, new()' 改为 'class, IPipelineFilter',使带依赖注入构造函数的 PipelineFilter 可经这些入口正常注册:

  • MultipleServerHostBuilder.cs(AddServer<,TPipelineFilter>、AddServer<TService,...,TPipelineFilter>)
  • HostBuilderExtensions.cs(AsSuperSocketHostBuilder<TReceivePackage,TPipelineFilter>)

未动 DefaultConstructorPipelineFilterFactory(其 new() 是类型设计必需,上游也未改动)。

验证

dotnet build GameFrameX.SuperSocket.sln -c Release:0 Error,227 Warning(全为预存 CS1591/CS0114,与本次改动无关)。

Linear: GFX-551

Summary by CodeRabbit

  • 功能改进
    • 配置 SuperSocket 服务时,管道过滤器不再强制要求提供公共无参构造函数。
    • 支持通过依赖注入或其他方式创建管道过滤器,提升配置灵活性。

对齐上游 kerryjiang/SuperSocket@e4531951,将 MultipleServerHostBuilder.AddServer 与 HostBuilderExtensions.AsSuperSocketHostBuilder 的 TPipelineFilter 约束由 'class, IPipelineFilter<>, new()' 改为 'class, IPipelineFilter<>',使带依赖注入构造函数的 PipelineFilter 可经这些入口正常注册。

Linear: GFX-551
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

GFX-551

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7c16a213-83ba-42cc-9dc7-dfcc1b8b4d19

📥 Commits

Reviewing files that changed from the base of the PR and between 43f9acb and c4a801d.

📒 Files selected for processing (2)
  • src/GameFrameX.SuperSocket.Server/Host/HostBuilderExtensions.cs
  • src/GameFrameX.SuperSocket.Server/Host/MultipleServerHostBuilder.cs

📝 Walkthrough

Walkthrough

本次变更移除三个主机生成器 API 对 TPipelineFilternew() 泛型约束。API 仍要求 TPipelineFilter 为引用类型并实现 IPipelineFilter<TReceivePackage>

Changes

管道筛选器约束

Layer / File(s) Summary
更新主机生成器 API 约束
src/GameFrameX.SuperSocket.Server/Host/HostBuilderExtensions.cs, src/GameFrameX.SuperSocket.Server/Host/MultipleServerHostBuilder.cs
AsSuperSocketHostBuilder 和两个 AddServer 重载移除 TPipelineFilternew() 约束。

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related issues

  • GameFrameX.SuperSocket issue 16:该变更直接移除 MultipleServerHostBuilder.AddServer 及相关 API 的 new() 约束。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了移除 PipelineFilter 默认构造函数限制并支持 DI 构造这一主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/GFX-551

Comment @coderabbitai help to get the list of available commands.

@AlianBlank
AlianBlank merged commit a0b8734 into main Aug 6, 2026
3 checks passed
@AlianBlank
AlianBlank deleted the feature/GFX-551 branch August 6, 2026 01:50
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.

1 participant