port: ServerStateChecker + module (batch 2 P2)
Verbatim 40250 CServerStateChecker and the ServerStateChecker Python
module replace the stub; PythonBoot owns the instance like
CPythonApplication::m_kServerStateChecker. The fake server gets a state
port that answers CG_STATE_CHECKER the way CInputHandshake and
CInputDB::RespondChannelStatus do; login_flow requests the channel list
after the character list (live: {1: 1, 2: 1}).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
be5a68ff35
commit
ce9f96398e
@@ -432,6 +432,7 @@ extension/third_party/cpython-2.7.18/ # 静态库(2P 批次
|
||||
2V3-a(2026-09-23):`PythonPlayer`、`PythonPlayerInput`/`InputKeyboard`/`InputMouse`、`PythonPlayerEventHandler`、`PythonPlayerSkill`、`PythonPlayerModule`、`GameType` 原样移植(port-map 标 PORTED),`GameplayModules.cpp` 的 `player` 桩删除,`initPlayer()` 按 40250 顺序在 `initchrmgr()` 后调用;`pending/UserInterface/{PythonPlayer,GameType}.cpp` 替身删除,其余被调方(`CPythonSkill`、`CItemData`、`CItemManager`、`CPythonItem` 等)进 `pending`。64 位修正:`playerGetEmotionIconImage` 用 `Py_BuildPointer`,`PyDict_Next` 用 `Py_ssize_t`。根运动:Granny 运行时的 `GrannyUpdateModelMatrix` 原为直通,按 TrackGroups[0] 的 `AccumulationFlags`(AccumulationExtracted)/`LoopTranslation`(libgr2 新读出,战士 run = (0,-300,0),同 .msa `Accumulation`)按控制器本地时钟推进与权重累加位移(Delta × ModelMatrix);VDA 抽取未实现。`port.login_flow` 按 DIK_UP 经 `game.GameWindow` → `player.SetSingleDIKKeyState` 行走 >100 cm,假服解析 CG 包,收到 `CG_MOVE` FUNC_MOVE 后 FUNC_WAIT 且坐标变化;`port.login_live` 2026-09-23 对 192.168.21.203 走 132 cm 通过。(2V3-a 的待办见 2V3-b。)
|
||||
2V3-b(2026-09-23):鼠标点地移动。`CScreen::SetCursorPosition`(GrpScreen.cpp:487)与 `CPythonGraphic::SetCursorPosition` 原样实现,`RenderGame` 每帧用光标建拾取射线;`CPythonBackground::GetPickingPoint`/`GetPickingPointWithRay`/`GetPickingPointWithRayOnlyTerrain` 按 `CMapOutdoor::__PickTerrainHeight` 原样沿射线步进,地形高度取 native `CMapManager::GetHeight`(`PR_FLOAT_TO_INT` 的 x87 取整按 floor),物件拾取随 `CMapOutdoor` 移植再接。`CMapManager::isAttrOn` 按 `CMapOutdoor::isAttrOn`+`CTerrain::isAttrOn` 读包内 `<map>/<xxxyyy>/attr.atr`(阻挡/水/禁 PK),`CheckAdvancing` 及两个碰撞检查器原样(地图物件未注册到 `CCullingManager` 前不会阻挡)。以上在 pending/platform 层,port-map 标 ADAPTED。`port.login_flow` 在按键行走后左键点击角色下方地面:`game.GameWindow.OnMouseLeftButtonDown` → `player.SetMouseState` → 角色走到拾取点(离线 334 cm),假服收到 FUNC_MOVE … FUNC_WAIT;另断言角色所在格不阻挡、所在地形块有阻挡格(离线 17814 格)。`port.login_live` 2026-09-23 对 192.168.21.203 通过(按键 133 cm、点地 296 cm、11406 阻挡格),`python_game_render_test.sh` 离线通过。`client_main` 的 `MT_TEST_MODE=python_ui` 加上 `python_3d_surface.gd`,新路径可手动登录进游戏走动。待办:默认路由切到 `port`(当前 `client_main` 默认仍走 GDScript `AppFlow`)后整体删除 legacy;攻击/拾取物品等 P1 战斗交互属批次 2 之后。
|
||||
批次 2 P0 收尾(2026-09-24):`UserInterface/PythonCharacterManager.cpp`(54 函数)与 `InstanceBaseMovement.cpp`(32 函数)在 2V2-b 已原样拷入 `port/`,2V3 起即是运行路径(行走、点地移动、远程角色同步都经它们),本轮逐行比对 40250(仅 include 大小写、注释编码和两处 `// PORT:` 修正:`CreateInstance` 的 TraceError 传 `m_dwVID`,`NEW_SyncPixelPosition` 用 32 位 `LONG &`),确认 pending/platform 无重复定义后标 PORTED。P0 队列已清空;P1 飞行物(同日):`GameLib/FlyingData`、`FlyingInstance`、`FlyingObjectManager`、`FlyTrace` 与 Python 模块 `PythonEffectModule`(`effect`)、`PythonFlyModule`(`fly`)原样移植,删除 `pending/GameLib/FlyingObjectManager.cpp` 替身和两个模块的桩,`initeffect()`/`initfly()` 按 40250 顺序在 `initnet()` 后调用;`CFlyingManager::SetMapManagerPtr(&CPythonBackground)` 按 40250 构造函数接上;`FlyTrace.h` 加 `// PORT:` include 以过头文件门禁。`CMapManager::GetTerrainHeight`(飞行物落地判断用)在 pending 层按 native 地形高度实现,`GetHeight` 转发到它(地图物件高度待 `CMapOutdoor`)。`ActorInstanceData.cpp` 早已原样在 port/,一并标 PORTED。`port.login_flow` 断言 `playersettingmodule.py` 已经 `effect.RegisterIndexedFlyData` 注册并能解析 `.msf`。特效本体(`CEffectManager`)仍是平台桩,飞行物不可见;队列里 P0/P1 已清空,剩下 P2 网络单元(多数已在 2V1 原样拷入 port/,待逐个核对后标记)。同日核对:队列中 28 个早已拷入 port/ 的单元(网络流各阶段、`AccountConnector`、`NetStream`/`NetDevice`/`NetAddress`、`EterPack*`、`lzo`/`tea`/`cipher`/`Timer` 等,372 函数)用 `port_copy.py diff` 比对,23 个与机械拷贝完全一致,其余 5 个的手改全部带 `// PORT:`(CP949 转义、`e-` pp-number、32 位 `LONG`、包密钥外置、`lzo_uint` 宽度、`ActivateCipher` 解密同批已收密文),平台层无同名替身,标 PORTED;logic 层 54.8% → 67.9%。队列剩余 P2 仅 `ServerStateChecker`(`ServerStateChecker` 模块仍是桩),其后是 P3 物品/小地图/名牌。
|
||||
P2 收尾(2026-09-24):`ServerStateChecker.cpp` 与 `ServerStateCheckerModule.cpp` 原样移植,删除模块桩,实例按 `CPythonApplication::m_kServerStateChecker` 由 PythonBoot 持有,`initServerStateChecker()` 按 40250 顺序调用。`port.login_flow` 在选角后按 intrologin 的 `__RequestServerStateList` 调 `AddChannel`/`Request`/`Update`,假服新增状态端口按 `CInputHandshake`+`CInputDB::RespondChannelStatus` 应答(先握手字节,再 `210,n,TChannelStatus[n],1`);`TChannelStatus::nPort` 是 short,假服临时端口 >32767 对不上自身频道,离线以第二个频道 13002 为证。`port.login_live` 真服返回 {1: 1, 2: 1}。P2 队列清空,下一步 P3 物品链。
|
||||
|
||||
每个切片都必须同时跑 legacy/port 双路回归;只有 2V3 稳定并把默认路由切到 `port` 后,才能删除总开关和剩余 legacy 宿主。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user