Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* 删除 GameFrameX.Apps.ActorType 死枚举(C219):运行时零引用(账号 id 实际由 ActorIdGenerator.GetUniqueId() 生成),作用域机制维持 GlobalConst.ActorType* 常量现状,并在 GlobalConst 与 ComponentTypeAttribute 的 XML doc 补区间规则(<128 每实体多实例 / >128 每服单例);非破坏性——两仓成员引用已验证为零,Apps 工程不进 NuGet 发布面
* 删除 GameFrameX.Online 与 GameFrameX.Online.Runtime 双工程(C232 / C227 P4 终态):单体剩余 9 上层/聚合目录与过渡壳内容已全量随 P3/P4 迁入 11 包(Hosting 3 + Online 8);slnx 摘除、csproj 与源文件物理删除(git rm);`bin/` 18 个陈旧产物(工程已不在 slnx,dotnet clean 无视)手动清除后 rebuild 零再生(lesson `msbuild-stale-output-after-project-removal` 正反断言);`OnlineDependencyMatrixTests` 目录依赖矩阵随目录消失退役(topic 字节冻结断言保留)
### Refactor
* 热更桥接实例去除启动基类继承并更名为生命周期桥接(C285,C284 后续):全仓唯一 `IHotfixBridge` 实现 `AppStartUpHotfixGame` 更名迁移为 `internal sealed HotfixModuleLifecycleBridge`(`GameFrameX.Hotfix/Lifecycle/`,命名空间 `GameFrameX.Hotfix.Lifecycle`)——`AppStartUpBase` 继承在 C284 后全为死重(no-op `StartAsync` 覆写、宿主已执行过的冗余 `AppBootstrapper.EnsureInitialized` / `InterNodeAuthentication.Configure` 装配、无人触碰的就绪屏障与退出令牌),新类不再属于启动 Role 体系;`Init` 内非冗余的 `GlobalSettings.SetCurrentSetting(setting)` 显式化保留并注释——多 Role 进程(`--AllInOne`)下把 `CurrentSetting` 钉回首启动 Role 的配置,且必须早于统一消息发送器构造固化本服身份(单 Role 形态无差异,行为等价);删除 no-op `StartAsync` 覆写、`using GameFrameX.StartUp;` 与整文件注释死块 `AppStartUpHotfixGameByGateWay.cs`;`GameFrameX.Hotfix.csproj` 移除对 `GameFrameX.StartUp` 的 ProjectReference(构建产物元数据正向证明:热更程序集引用表不含启动程序集,桥接类基类为 `System.Object`);`IHotfixBridge` 公开契约不变,`HotfixModule.ParseDll` 按接口定位机制不变

* Online 依赖解环与方向治理(C223,能力簇拆包前置 P0):`Events/` 收窄为事件总线抽象(OnlineEvent / IOnlineEventPublisher / OnlineEventPublisher / OnlineEventConsumer / OnlineEventSanitizer / OnlineEventEnvelopeMapper / OnlineEventAuditView,与域类型零引用);13 个域事件工厂随域迁移并载荷原始化(工厂签名领域类型参数 → 原始字段参数,topic 常量与信封语义逐字节不变);跨叶子协作契约上移 Contracts(IOnlineSocialGate / OnlineSocialInteractionPurpose / OnlineSocialDecision / IOnlineChannelMembershipProbe / OnlineChatChannelKind)。程序集内目录依赖成为严格向下 DAG(含三节点环 Events→HotfixRollback→Audit→Events 解除),新增依赖矩阵门禁测试(OnlineDependencyMatrixTests:using 语义解析 + 允许方向表 + 叶子簇横向零互引 + topic 常量冻结断言,零豁免)。公共类型命名空间迁移映射(程序集内迁移,无 NuGet 包消费者,破坏面纯源码级,消费者仅 GameFrameX.Online.Runtime 与 Tests):
`GameFrameX.Online.Events.OnlineAssetEvents → GameFrameX.Online.Assets`;
Expand Down
5 changes: 3 additions & 2 deletions GameFrameX.Core/Session/PlayerDisconnectedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ namespace GameFrameX.Core.Session;
/// <remarks>
/// 宿主持监听形态下,宿主会话断开钩子完成会话摘除后以本事件把「已绑定玩家的物理断开」
/// 通知热更域——热更侧全局监听器承接房间断线标记与会话恢复通知(原内联在热更侧
/// <c>AppStartUpHotfixGame.OnDisconnected</c> 的业务段)。事件绑定键即本类型本身;
/// <c>AppStartUpHotfixGame.OnDisconnected</c> 的业务段;原名,C285 更名为 HotfixModuleLifecycleBridge)。事件绑定键即本类型本身;
/// 分发为全局(actorId = 0)fire-and-forget,与 <see cref="SessionRemovedEventArgs"/>
/// 登出清理同形态。携带断开的物理会话标识供热更侧旧回调迟到守卫使用。
/// Under the host-owned-listener shape, the host's session-disconnected hook removes the
/// session and then uses this event to notify the hotfix domain that a bound player's
/// physical connection dropped — the hotfix-side global listener carries the room
/// disconnected-marking and the session-resume notification (the business block formerly
/// inlined in the hotfix-side <c>AppStartUpHotfixGame.OnDisconnected</c>). The event binding
/// inlined in the hotfix-side <c>AppStartUpHotfixGame.OnDisconnected</c>; renamed
/// <c>HotfixModuleLifecycleBridge</c> in C285). The event binding
/// key is the type itself; dispatch is global (actorId = 0) and fire-and-forget, the same
/// shape as the <see cref="SessionRemovedEventArgs"/> logout cleanup. The disconnected
/// physical session identifier is carried for the hotfix-side stale-callback guard.
Expand Down
1 change: 0 additions & 1 deletion GameFrameX.Hotfix/GameFrameX.Hotfix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<ProjectReference Include="..\GameFrameX.Core\GameFrameX.Core.csproj" />
<ProjectReference Include="..\GameFrameX.Network.HTTP\GameFrameX.Network.HTTP.csproj" />
<ProjectReference Include="..\GameFrameX.Network.Abstractions\GameFrameX.Network.Abstractions.csproj" />
<ProjectReference Include="..\GameFrameX.StartUp\GameFrameX.StartUp.csproj" />
<ProjectReference Include="..\GameFrameX.Utility\GameFrameX.Utility.csproj" />
<ProjectReference Include="..\Capability\GameFrameX.Capability.Online.Abstractions\GameFrameX.Capability.Online.Abstractions.csproj" />
<ProjectReference Include="..\GameFrameX.Architecture.Analyzers\GameFrameX.Architecture.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,44 @@
// ==========================================================================================


using GameFrameX.StartUp;
using GameFrameX.Core.Session;
using GameFrameX.Network.RemoteMessaging;
using GameFrameX.Discovery.Routing;
using GameFrameX.Network.RemoteMessaging.Routing;
using GameFrameX.Hotfix.Logic.Server.Unified;
using GameFrameX.Network.RemoteMessaging.Unified;

namespace GameFrameX.Hotfix.StartUp;
namespace GameFrameX.Hotfix.Lifecycle;

/// <summary>
/// 热更桥接实例(C284 统一形态):热更域只持业务生命周期——装载成功激活配置表/定时器/全局组件,
/// 停止只清 Actor/定时器/会话;网络监听与运行至退出周期归宿主(<c>AppStartUpGameServerBase</c> 模板)。
/// 热更模块生命周期桥接(原名 <c>AppStartUpHotfixGame</c>,C285 去启动基类继承并更名迁移):
/// 热更域只持业务生命周期——装载成功激活配置表/定时器/全局组件,停止只清 Actor/定时器/会话;
/// 网络监听与运行至退出周期归宿主(<c>AppStartUpGameServerBase</c> 模板)。
/// 本类是 <see cref="IHotfixBridge"/> 的唯一实现,由 <c>HotfixModule.ParseDll</c> 按接口定位并创建,
/// 不属于启动 Role 体系(不进 <c>StartUpTypeRegistry</c> / <c>AppEnter</c>,不继承任何启动基类)。
/// </summary>
/// <remarks>
/// The hotfix bridge instance (the C284 unified shape): the hotfix domain holds only the business
/// lifecycle — a successful load activates the config tables, timers and global components while
/// the stop clears actors, timers and sessions; the network listeners and the run-until-exit cycle
/// stay with the host (<c>AppStartUpGameServerBase</c> template).
/// The hotfix-module lifecycle bridge (formerly <c>AppStartUpHotfixGame</c>; C285 dropped the
/// startup-base inheritance, renamed and relocated the type): the hotfix domain holds only the
/// business lifecycle — a successful load activates the config tables, timers and global components
/// while the stop clears actors, timers and sessions; the network listeners and the run-until-exit
/// cycle stay with the host (<c>AppStartUpGameServerBase</c> template).
/// This class is the sole implementation of <see cref="IHotfixBridge"/>, located and instantiated
/// by <c>HotfixModule.ParseDll</c> via the interface; it does not belong to the startup-role
/// system (never enters <c>StartUpTypeRegistry</c> / <c>AppEnter</c> and inherits no startup base).
/// </remarks>
internal class AppStartUpHotfixGame : AppStartUpBase, IHotfixBridge
internal sealed class HotfixModuleLifecycleBridge : IHotfixBridge
{
/// <summary>
/// 热更模块装载成功回调:纯业务生命周期激活(初始化 + 统一消息发送器装配 + 配置表 + 定时器 +
/// 全局组件)。热更重载(<paramref name="reload"/> = true)只清空代理缓存,不重复激活。
/// 热更模块装载成功回调:纯业务生命周期激活(CurrentSetting 钉住 + 统一消息发送器装配 +
/// 配置表 + 定时器 + 全局组件)。热更重载(<paramref name="reload"/> = true)只清空代理缓存,
/// 不重复激活。
/// </summary>
/// <remarks>
/// The hotfix-module load-success callback: pure business-lifecycle activation (initialization,
/// the unified-message-sender wiring, config tables, timers and global components). A hot
/// reload (<paramref name="reload"/> = true) only clears the agent cache without re-activating.
/// The hotfix-module load-success callback: pure business-lifecycle activation (the
/// CurrentSetting pin, the unified-message-sender wiring, config tables, timers and global
/// components). A hot reload (<paramref name="reload"/> = true) only clears the agent cache
/// without re-activating.
/// C284 起不再起网络监听(监听所有权归宿主),也不分发 <c>ServiceOnline</c>(宿主
/// <c>OnStartupCompletedAsync</c> 是唯一分发点,避免与宿主缺省分发双派发)。
/// Since C284 this callback no longer starts network listeners (listener ownership stays with
Expand All @@ -76,7 +84,13 @@ public async Task<bool> OnLoadSuccess(AppSetting setting, bool reload)
return true;
}

Init(setting.ServerType, setting);
// 多 Role 进程(--AllInOne)中钉住 CurrentSetting(C285 自 AppStartUpBase.Init 显式化):
// Launcher 的创建循环先对全部 Role 逐个 Init,SetCurrentSetting 对 Role 级字段接受最新值,
// 循环结束时 CurrentSetting 指向最后创建的 Role;热更首次装载由首个启动的 Role 触发,
// 这里把 CurrentSetting 钉回该首启动 Role,且必须早于 UnifiedMessageSender 构造——
// 其构造器读取 CurrentSetting 固化本服身份(另有路由/会话等调用期读取方)。
// 单 Role 形态无差异;直接删除会让上述消费方的服务器身份漂移。
GlobalSettings.SetCurrentSetting(setting);
// 初始化统一消息发送器:resolver 按发现层可用性选择——
// 启动流程先 Activate 发现层(含 player_route 读侧),后加载 Hotfix,故此处
// Bootstrap.Resolver 必然已就绪;未激活发现层的形态回落 DefaultPlayerRouteResolver。
Expand Down Expand Up @@ -136,18 +150,4 @@ public async Task Stop(string message = "")
await ActorManager.RemoveAll();
}

/// <summary>
/// 基类抽象成员的最小实现:C284 统一形态下监听与「运行至退出」周期归宿主,热更实例不再自持
/// 运行循环,宿主不调用本方法。
/// </summary>
/// <remarks>
/// The minimal implementation of the base abstract member: under the C284 unified shape the
/// listeners and the run-until-exit cycle stay with the host, the hotfix instance no longer
/// runs its own loop, and the host never calls this method.
/// </remarks>
/// <returns>已完成的任务 / A completed task</returns>
public override Task StartAsync()
{
return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ namespace GameFrameX.Hotfix.Logic.ServerRole.SessionResume;

/// <summary>
/// 玩家物理断开业务监听器(C284 宿主→热更事件桥接承接方):房间断线标记 + 会话恢复两层协同通知
///(语句自原热更侧 <c>AppStartUpHotfixGame.OnDisconnected</c> 内联段搬移,语义逐字保持)。
///(语句自原热更侧 <c>AppStartUpHotfixGame.OnDisconnected</c> 内联段搬移,语义逐字保持;
/// 原名,C285 更名为 HotfixModuleLifecycleBridge)。
/// </summary>
/// <remarks>
/// The player-disconnect business listener (the C284 host-to-hotfix event-bridging sink): marks the
/// player disconnected in the room system and notifies the session-resume two-layer coordination
/// (statements moved verbatim from the inlined block of the former hotfix-side
/// <c>AppStartUpHotfixGame.OnDisconnected</c>). 全局分发(actorId = 0)下代理参数为 null,
/// <c>AppStartUpHotfixGame.OnDisconnected</c>; renamed <c>HotfixModuleLifecycleBridge</c> in C285).
/// 全局分发(actorId = 0)下代理参数为 null,
/// 房间代理在处理内自取(与原内联段同源 <c>ActorManager.GetComponentAgent</c> 全局重载);
/// <see cref="SessionResumeDomainBridge.NotifyPlayerDisconnectedAsync"/> 自带旧回调迟到守卫,
/// 恢复先于旧断开回调到达时安全跳过。
Expand Down
Loading
Loading