feat(network): Stage-5c+5d 跨服玩家路由 + player_route + SessionManager 钩子 - #497
Merged
AlianBlank merged 3 commits intoSep 22, 2026
Merged
Conversation
在 NetWork.RemoteMessaging 包内实现跨服玩家路由层(C143e D21): player_route 控制库集合 + IPlayerRouteResolver 三级查找接口 + Mongo 版本 CAS 同步目标 + 装配入口 + 信封接收端 LocalEnvelopeDispatcher。 新增 IPlayerRouteFastPath 反向依赖解耦缝,避免 RemoteMessaging 引用 GameFrameX.Apps。MongoDiscoveryRuntime.Activate 末尾追加 Bootstrap 装配。 RoleRouteEnvelopeMessage 启用 MessageTypeHandler 特性;RoleRouterHolder 暴露 IsInitialized。PerInstanceDedupe 提供跨服投递 1 秒单飞窗口。
GameFrameX.Apps 项目新增 SessionManagerFastPathAdapter 把内存态 PlayerRouteMap 暴露为 IPlayerRouteFastPath;SessionManager 暴露 PlayerRouteSyncTarget 静态注入点,SetPlayerRouteOnline/Offline 在 内存态落定后调用钩子(失败 swallow + warning,主链路不挂)。 GameFrameX.Apps.csproj 新增 NetWork.RemoteMessaging 引用。 AppStartUpGame/Social 调用 Activate 时传入 fast-path 适配器,并把 MongoPlayerRouteResolverBootstrap 暴露的 SyncTarget 注入 SessionManager。
Tests/GameFrameX.Tests 新增 MongoPlayerRouteResolverTests 单元用例: IPlayerRouteFastPath 在线/离线/错玩家分支 + PlayerRouteInfo 工厂 + NullPlayerRouteSyncTarget NoOp 验证(7 用例)。 MongoPlayerRouteIntegrationTests Mongo 集成:SyncTarget 首登 upsert / CAS 成功 / CAS 失败抛 PlayerRouteStaleException / Delete / 索引 (playerId 唯一 + lastSeenAt TTL 30 天)断言 / Resolver Tier 1 命中 /Tier 2 命中/全 miss 返回 Offline 三路径(8 用例,沿用 GAMEFRAMEX_TEST_ MONGODB_CONNECTION_STRING 门控)。
|
Warning Review limit reachedNext included review available in 53 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (22)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
AlianBlank
deleted the
feature/auto-server-source-worker-run-7775-20260922T0700
branch
September 22, 2026 07:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



概要
C143e(Stage-5c+5d 跨服玩家路由)落地:player_route 控制库集合 + IPlayerRouteResolver 三级查找 + Mongo 版本 CAS 同步 + 信封接收端 LocalEnvelopeDispatcher + SessionManager 同步钩子。
3 个原子提交:
关键决策
验证
dotnet build Server.slnx:通过变更文件