Commit Graph
92 Commits
Author SHA1 Message Date
shenleiandClaude Opus 5 369a80fc10 port(2V0-a): EterPythonLib 窗口系统的头进镜像
2V0 的入口实测:audit/slices/2V0.json 的 212 个头里 164 个已经在镜像中,缺 48 个
(1 个 EterLib、5 个 EterPythonLib、42 个 UserInterface);10 个单元里已移植 2 个。
本轮补 EterPythonLib 这 5 个,外加必须先有的 EterPythonLib/StdAfx.h —— port_header_gate
按 40250 的做法把每个头放在所属库的 StdAfx.h 后面编译,没有它这五个既看不到
<Python.h> 也看不到 STL 和 CSingleton。

6 个文件全是 port_copy.py 的机械拷贝,0 处手改。

顺带修正清单的一处误报:EterLib/Dimm.h 不是 40250 的源文件,是 Windows SDK <dimm.h>
的 MIDL 产物,port/common/shim/win32/Dimm.h 已经顶掉了;镜像一份反而遮住 shim,
EterLib/IME.h 的 #include "Dimm.h" 会去找 rpc.h。拷进来验证后删掉。

只有头,没有 .cpp,所以没有 port-map 条目 —— 只有声明,没有可调用的东西。
port_header_gate 新增 6 个 TU 全绿;ctest 27/27。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 10:50:24 +09:00
shenleiandClaude Opus 5 0a1cdf3d3e feat(python): 在 app 进程里起 40250 脚本层(2P step 4,macOS)
移植 UserInterface/RunMainScript 到 platform/ScriptLib/PythonBoot:40250 把
CPythonLauncher 放在 Main() 的栈上,这里进程归 Godot,launcher 必须活过创建它的
那次调用,所以拆成 Start / RunMainScript / RunLine / Stop。37 个模块初始化函数里
只调已移植的 initpack(),system.py 因此仍停在第一个 import。

脚本报错能传回 GDScript,靠的是 platform/EterBase/Debug.cpp 实现 LogBox/LogBoxf:
ScriptLib 的 Traceback() 在 PyErr_Fetch 之后只剩这一条路,LastLogBoxMessage()
(platform/EterBase/LogBox.h)是 traceback 唯一幸存的地方。

GDScript 侧新增 Metin2PythonHost(python_host_node.{h,cpp})——唯一同时认识
godot-cpp 和 port 树的单元,PythonBoot 保持 godot-free。检查脚本
python_host_check.gd 分两段:解释器 + 标准库那段不需要 40250 的 pack,哪个平台都
能跑;system.py 那段需要 pack,没有就跳过。桌面入口 python_host_test.gd,真机入口
MT_TEST_MODE=python(导出模板不接受 --script)。

验证(macOS):标准库可 import、codec 注册表可用、sys.path 非空,system.py 停在和
ctest port.python_launcher 完全相同的 ImportError: No module named app;
ctest 27/27。Android/iOS 进程内未做,正式启动路径仍不起解释器(2V0)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 10:43:10 +09:00
shenleiandClaude Opus 5 e926759ff5 test(net): 去掉 net 测试的 flaky,顺带把整套 ctest 从 78.7s 降到 8.7s
全量 ctest 连续两次各挂一个 net 测试,且挂的不是同一个,压测后定位到
四个互相独立的原因,全部在测试自身,产品代码未改动。

1. accept_loopback(): poll() 的 `<= 0` 把 EINTR 当成对端从未连接,且单片
   500ms 超时在有负载时不够。50 轮压测里 4 次失败全部源于此。改为 EINTR
   重试 + 5s 截止时间(listener 本就非阻塞,超时后 accept 不会挂住)。
2. :570 的 pump 循环条件抄自上面的死端口用例,但此处 connect 会成功,
   stage 先经过 LoggingIn,循环提前一步退出。
3. 同文件 5 处手写 pump 循环只给 10-20ms 等真实 loopback socket。新增
   pump_until(session, want, max_ms=2000) 统一替换,等的是断言真正关心
   的那个状态。
4. net_loopback_test 的 10 处 run(..., N, []{return false;}) 是固定空转
   而非等待条件。服务端批量收包改用该批最后一个包的标志作条件(TCP 有序),
   客户端事件用本地累加器在谓词里 drain。

提速:两处 this-*-host-must-not-resolve.invalid 换成带空标签的名字。本机
解析器不按 RFC 6761 本地拒绝 .invalid,每次发往上游等满 30s 超时;空标签
让 getaddrinfo 在语法层返回同一个 EAI_NONAME,实测 <10ms。
net_classic_session_test 61.2s -> 3.5s;loopback 改条件退出后 0.94s。

验证:net_classic_session_test 100/100(修复前 50 轮挂 4 轮);
net_loopback_test 100/100(修复前单独跑第 7 轮即挂);全量 ctest 27/27;
port_map.py check 0 error;8 个 pack key 值均未入库。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 10:26:51 +09:00
shenleiandClaude Opus 5 389b643863 docs: 记录 Android GBK 编解码的已知问题(挂起)
用户决定:先保证 macOS 可用,Android 后期再想办法。本次只记录根因,
不动 text_codec.cpp。

症状:build-android.sh 默认 API 24 下 extension/src/net/text_codec.cpp 报
use of undeclared identifier 'iconv_open'。

根因:text_codec.cpp:10 用 __has_include(<iconv.h>) 探测;NDK 里该头在任何
API 等级都存在,但声明被 __BIONIC_AVAILABILITY_GUARD(28) 挡住。用
NDK 28.2 的 clang++ -fsyntax-only 实测:android24 报 3 处 undeclared,
android28 通过。

但升 API 不是解法:NDK iconv.h 写明 bionic 只支持 utf8/ascii/usascii/
utf16{be,le}/utf32{be,le}/wchart,没有 GB2312/GBK。升到 28 后
iconv_open("GB2312","UTF-8") 运行期返回 -1,encode_one()/decode_wire()
对所有输入都返回 false——连纯 ASCII 也被拒,比现有 #else 的 ASCII 回退
分支(text_codec.cpp:104-127)更糟。且 APK min_sdk 要跟着 >=28,
config/android/pyconfig.h 是 API 24 下 configure 的,需返工。

将来的修法写进了 PORT-PLAN 的新小节。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 09:57:27 +09:00
shenleiandClaude Opus 5 19a9b18554 docs: 目标平台收窄为 macOS arm64 + Android arm64
用户决定:Linux 和 Windows 不做,不验收、不作为任何步骤的阻塞项。

- PORT-PLAN 第 1 节写明范围;2A step 3 的平台列表、2P step 1/2 措辞跟着改;
  2P step 4 由「五个平台分别验证」改为「两个目标平台」,Linux/Windows 两行
  划掉但保留原因备查(上游 2.7 只支持 MSVC + PC/pyconfig.h,mingw 下
  posixmodule.c / dynload_win.c 与 MinGW 头文件冲突)。
- PLATFORMS.md 新增 Scope 段;THIRD-PARTY.md 的 CPython Windows 段由
  "not built yet" 改为 out of scope;PYTHON-EMBED-EVAL.md 下一步两条。
- 仓库里的 mingw-w64 交叉编译只留作可移植性门禁(它抓到过
  UserInterface/StdAfx.h 的真问题),不代表支持 Windows。
- iOS arm64 暂按次要目标记录:保持交叉编译干净,但不作为验收目标。

仅文档改动。port_map.py check 0 error;参考 EterPack.cpp 的 8 个 pack key
值逐个 git grep --cached -w,均未入库。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 09:53:28 +09:00
shenleiandClaude Opus 5 ffbb5d48d6 port(2P step 3c): stage python27.zip into the mobile sandbox
CPython opens the stdlib zip with its own stdio, so it needs a real path.
On the desktop res:// is a directory and globalize_path() is enough; in an
exported build res:// is inside the PCK, which nothing outside Godot reads.

  make_stdlib_zip.py now also writes <out>.sha256
  mtpython_stdlib_project copies python27.zip + .sha256 into project/
    (gitignored), and both export presets' include_filter lists them, so
    they enter the PCK — checked with --export-pack
  extension/src/python_stdlib.{h,cpp} (Metin2Python.stdlib_path in
    GDScript): reads the bytes out of the PCK, writes
    user://python27.zip.part, hashes the file as written against the
    shipped digest, then renames. A sandbox copy is reused only when it
    matches, so a first start killed mid-copy and a zip replaced by a new
    build both re-stage instead of feeding zipimport a torn file.
  PythonHost::SetDefaultStdLibPath / DefaultStdLibPath() answer with that
    path ($MT_PYTHON_STDLIB still wins). python_stdlib.cpp is the only unit
    that knows res:// / user://; port_platform stays godot-free.

Also fixes the Windows gate, which step 3b broke: without mtpython the
MinGW build compiled UserInterface/StdAfx.h (it includes ScriptLib/StdAfx.h,
as the original PCH does). port/CMakeLists.txt excludes that header and
PythonPackModule.cpp with ScriptLib, and platform/CMakeLists.txt excludes
platform/ScriptLib/ the same way.

Not done: on-device staging. The macOS test drives the mobile path with
force_stage=true, and nothing in the app boot calls it yet — the
interpreter only starts in the process with 2V0.

gates: python_stdlib_test.gd PASS (in-place path, staging, sha256, bytes
equal res://, no .part, ZIPReader finds encodings/__init__.py, no re-copy
on a second call, corrupted copy re-staged) · macOS ctest 27/27 ·
mingw + android + ios port_platform compile clean · port_map.py check 0
errors · key leak check 8/8 none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 09:39:33 +09:00
shenleiandClaude Opus 5 2b873f190f port(2P step 3a/3b): stdlib on sys.path + the pack module
step 3a — 标准库:
  tools/py_embed/make_stdlib_zip.py packs the vendored Lib/ into
  <build>/python27.zip (397 modules, 6876547 bytes, ZIP_STORED — the zlib
  module is trimmed out of our CPython, so zipimport cannot inflate).
  The mtpython_stdlib target builds it; py_embed_test and the launcher test
  both run against it.
  platform/ScriptLib/PythonHost sets the embedding flags before
  Py_Initialize and, after it, puts the zip on sys.path and re-registers
  encodings.search_function with codecs — 2.7 builds the codec registry
  once, at startup, so replacing sys.path afterwards needs it back.

step 3b — pack 模块:
  UserInterface/PythonPackModule.cpp copied verbatim; packExist/packGet/
  initpack read root/ and uiscript/ through CEterPackManager, i.e. through
  asset_io. The CHINA_CRYPT_KEY block in that unit is CAccountConnector's
  and is kept #if 0 until the login slice (2V1). UserInterface/StdAfx.h is
  a documented partial mirror — the original is the whole client's PCH.

The launcher test now runs initpack() as RunMainScript does (its first
line), reads system.py / uiscript / locale text back out of the packs, and
confirms cp1252 decoding works off the zip. system.py still stops at
"No module named app" — the C++ modules are the 2V0 slice.

gates: port_map.py check 0 errors · key leak check 8/8 none · macOS ctest
27/27 · android + ios port_platform compile clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 09:16:37 +09:00
shenleiandClaude Opus 5 43bb561551 port(2P step 2): ScriptLib/PythonLauncher on the embedded interpreter
Link mtpython into port_logic and copy 40250's ScriptLib launcher across:
PythonLauncher, PythonUtils and PythonMarshal, plus the 12 forwarding headers
that make its `#include <Python-2.7/*>` lines compile unchanged. symtable.h
forward-declares mod_ty rather than including Python-ast.h, whose one-word
macros (Delete, Module, Set, Print) collide with EterLib/Pool.h — the same
clash 40250 sidestepped by commenting out PySymtable_Build.

Two `// PORT:` edits: `unsigned char(val)` is an MSVC extension (PythonUtils.cpp,
twice), and PyObject_AsCharBuffer wants a Py_ssize_t* (TraceFunc).

port_python_launcher_test drives the launcher in the order UserInterface.cpp
does (:241-434): Create(), __DEBUG__/__COMMAND_LINE__, TRUE/FALSE, a CRLF script
through RunMemoryTextFile, a .pyc through RunCompiledFile, then RunFile reading
system.py out of the real pack. It stops at `ImportError: No module named app`,
i.e. the first C++ module RunMainScript registers — that is the 2V0 slice, and
the stdlib behind it is step 3. The host flags (Py_NoSiteFlag and friends) sit
in the test for now; step 3 moves them into the platform layer.

port-map statuses are set only for what the test actually executes: 10 of 12
launcher functions and 4 of 11 marshal ones (the small-.pyc path delegates to
CPython's own reader, so the ported r_object stays unreached). PythonUtils
compiles but nothing calls it until the binding modules arrive, so it stays TODO.

Windows has no mtpython yet, so port_logic drops ScriptLib and the shims there.

Tests: macOS ctest 27/27 incl. port.python_launcher; port_logic (with ScriptLib)
also compiles for android arm64 (NDK API 24) and ios arm64.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 08:54:48 +09:00
shenleiandClaude Opus 5 5fad769ee8 port 2P step 1: vendor CPython 2.7.18 as the mtpython static library
The embedded 40250 script layer needs its own interpreter on five platforms.
2.7 is end-of-life, so nothing can be fetched from the target SDKs and the
source is vendored (official 2.7.18 tarball, trimmed to 25MB; Lib/ stays for
step 3's python27.zip).

cpython-2.7.18/CMakeLists.txt builds one `mtpython` static library from exactly
the 133 objects the reference libpython2.7.a contains, off by default behind
-DMTGODOT_EMBED_PYTHON=ON. The source list and the built-in module table
(config/config.c, 39 entries) are shared; pyconfig.h is a probe result and is
not, so each platform keeps its own under config/<platform>/, regenerated by
tools/py_embed/gen_pyconfig.sh and checked against the shared table.

Three vendor patches, documented in docs/THIRD-PARTY.md: configure/configure.ac
learn arm64 on macOS, and posixmodule.c undefines the process-control calls it
hard-defines past pyconfig.h when building for iOS.

macOS (ctest python.embed: every builtin imports, codecs and pickle work off the
vendored Lib/), Android arm64 and iOS arm64 build. Linux needs a Linux host and
Windows needs a MinGW-vs-MSVC decision; both are noted for step 4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 08:27:35 +09:00
shenleiandClaude Opus 5 a9b31dec67 port 2D steps 3-4: strict 40250 asset gate with a provenance manifest
tools/asset_manifest.py records path/size/sha256 of pack/Index, every .eix/.epk
and Eternexus/root/*.msm (audit/assets/40250-client.json). The gate script sets
MT_ASSETS_STRICT=1, verifies the manifest, runs the native pack/proto tests and
four Godot tests, and fails on a missing client, a mismatch or a skip.
MT_40250_CLIENT now comes from the environment for the native tests too.
remote_player_test accepts both weighted WAIT variants (wait/wait_1).
PORT-PLAN §5 records the 2D status.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 01:41:38 +09:00
shenleiandClaude Opus 5 240d2827c6 port 2D step 1: look up root/<cls>_<m/w>.msm first (40250 root pack layout)
40250 playersettingmodule.py loads chrmgr.LoadLocalRaceData("warrior_m.msm") from
root/; m2dev root/msm/ stays as the fallback. equip_model_test checks all 8
races resolve from Eternexus/root with shape 0 under pc/ (0..3) or pc2/ (4..7).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 01:35:40 +09:00
shenleiandClaude Opus 5 232d0461be port 2D step 2: 40250 item_proto/mob_proto through CLZO and pack://locale/<lang>/
proto.cpp reads the 40250 MIPX/MMPT tables with the ported CLZO/TEA (156-byte
TItemTable, 255-byte SMobTable), replacing the m2dev XChaCha20 236/335 reader.
Names follow CItemData::GetName / GetMonsterName (szLocaleName, cp1252).
GDScript callers load AssetRoot.locale_file() = pack://locale/en/<name>, which
makes the EterPack chain runtime-reachable; port-map entries for the functions
a coverage run hit move to PORTED/ADAPTED.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 01:34:08 +09:00
shenleiandClaude Opus 5 5a26e93f07 port 2D step 5b: PackInitialize + pack:// asset_io backend over the ported EterPackManager
Platform UserInterface PackInitialize/PackSingletons (40250 bootstrap, on-disk dbname
resolution), EterBase/FileLoader.cpp mirror, mtpack40250 backend behind asset_io's
pack:// scheme and a Metin2Pack node. port_eterpack_test now registers through
PackInitialize. Nothing reads pack:// at runtime yet; port-map stays TODO.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 01:31:17 +09:00
shenleiandClaude Opus 5 1f1004da79 port 2D step 5a: EterPack/EterPackManager + EterBase file units against the real 40250 packs
- Mirror copies: EterPack (EterPack, EterPackManager, EterPackCursor, CSHybridCrypt policy, Inline.h)
  and EterBase logic units tea/lzo/Timer/Stl/Random, with PORT-tagged width fixes (LONG index
  fields, static_assert(sizeof(TEterPackIndex) == 192), tea_word = Win32 unsigned long).
- TEA pack keys are extracted from the reference EterPack.cpp at configure time into
  build/.../EterPackKeys.generated.h; nothing key-bearing is tracked.
- Platform EterBase: FileBase (stdio, case-insensitive fallback), MappedFile (mmap /
  MapViewOfFile), CRC32, Debug, Utils StringPath/StringLowers.
- Win32Crt: CreateDirectory/DeleteFile/_access/MAKEFOURCC; Win32MinMax.h min/max (force-included
  on MinGW, whose windows.h omits them in C++).
- tests/port_eterpack_test: registers pack/Index like PackInitialize and checks 119
  registrations / 103 packs + root / 54891 entries / 52609 paths / 2282 overrides with
  first-registered-wins, and that exactly the 4 short-layout SECURITY files fail to load.
- 2R count corrected (136 -> 119 registrations, 103 distinct packs + root).

Not runtime-reachable yet (asset_io pack backend is step 5b), so port-map statuses stay TODO.
port_gate: macos/android/ios/windows PASS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 00:56:39 +09:00
shenleiandClaude Opus 5 f210f47076 Batch 2R: 40250 pack inventory (epk_scan) and delivery decision
Read-only scanner for Client/pack following PackInitialize -> CEterPackManager
-> CEterPack::__BuildIndex/Get2. Keys are read from the reference EterPack.cpp
at run time; none are stored. Pure-Python TEA + LZO1X.

- 136 registered packs, 54,891 entries: NONE/COMPRESS/SECURITY only, no
  PANAMA/HybridCrypt, all entries decode
- first-registered pack wins; 2,282 shadowed entries (2,194 differ)
- metin2_patch_{sd,mineral,mundi} use a second packer layout; 4 SECURITY
  files fail 40250's CRC check and never load in the original
- no case collisions; paths are already lowercase
- PORT-PLAN: read EPK on device via ported EterPack, base install minus
  extra locales, rebuild dict in Index order on any pack change

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 23:59:18 +09:00
shenleiandClaude Opus 5 220f15b404 port: 2A step 6, port-map re-baseline
Fix the per-function inventory against the clang-derived platform skeleton:
strip comments, accept indented qualified definitions in namespace blocks,
long parameter/initializer lists and all-caps qualified ctors, and skip
constructor initializer entries. Split EterBase by unit: tea/lzo/cipher/
Random/Stl/Timer/Poly become logic, the file/OS units stay platform; drop
the 8 obsolete platform stubs and regenerate audit/slices.

Baseline: logic 3343, python 5175, platform 2091 (10609), 0 done.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 23:21:24 +09:00
shenleiandClaude Opus 5 9a8e11f3dd port 2A step 4: platform skeleton + rest of the 2V3 header closure
- Mirror the remaining non-Python 2V3 closure headers (98 more, 173 total): EffectLib,
  EterGrnLib, SpeedTreeLib, SphereLib, PRTerrainLib, EterImageLib, EterBase/Poly, cipher/tea,
  EterLib Grp*/IME/Input/MSWindow/StateManager, GameLib actor/map/race headers, EterPack.
- SDK shims: granny.h, SpeedTreeRT.h, imm.h, Dimm.h (the SDK MIDL header, not mirrored),
  dinput/d3dx8 additions; D3D8 render-state enums, FVF macros and the COM resource hierarchy;
  more Win32 GDI/handle types with layout static_asserts.
- PORT edits for MSVC-permissive code (typename, friend visibility, <algorithm>, pointer→uintptr_t)
  and PRTerrainLib/StdAfx.h dropping the ScriptLib/Python include.
- port_logic links the vendored cryptopp/minilzo.
- extension/src/platform: port_platform target with 103 generated stub files (1917 function
  stubs, 146 static members) from the new platform_stub.py (clang -ast-dump-filter);
  MT_PLATFORM_STUB() marks every unimplemented body. libmtgodot links port_platform and
  port_gate.sh builds it.

Gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 21:46:24 +09:00
shenleiandClaude Opus 5 fc47582017 port 2A step 2: copy the 40250 header closure into the port mirror
76 closure headers (EterBase, EterLocale, EterPack, EterLib, GameLib, MilesLib,
EffectLib, SphereLib, EterImageLib) copied by the new port_copy.py (CP949->UTF-8,
LF, include-path case only); platform-class headers go to the mirror path too, as
the interface platform/ implements. Six manual `// PORT:` edits (Random, Singleton,
Pool, Stl, Utils, FlyTarget).

- common/D3D8Types.h: D3D8 value types with SDK values/layout, opaque COM interfaces
- common/shim/sdk (d3d8/d3dx8/mss) on every platform, common/shim/win32 off Windows
- Win32Types/Win32Crt: HRESULT, GUID, LARGE_INTEGER, LOGFONT/TEXTMETRIC, _atoi64,
  CRITICAL_SECTION on std::recursive_mutex
- header gate prepends each library's StdAfx.h (40250's precompiled header)

port_gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).
ScriptLib/EterPythonLib/UserInterface wait for 2P (their StdAfx includes Python).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 20:27:57 +09:00
shenleiandClaude Opus 5 0f2eee0b24 port/common: platform-independent D3DX8 math layer
D3DXVECTOR2/3/4, D3DXMATRIX, D3DXQUATERNION, D3DXPLANE, D3DXCOLOR with
d3dx8math.inl operator semantics, plus the D3DX* functions the 2V3 slice
logic uses. Covered by port.common; port_gate passes on macOS, Android,
iOS and Windows (mingw).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 20:02:15 +09:00
shenleiandClaude Opus 5 2bae8d7644 port(2A): port/common Win32 layer, port_logic target and header gate
- Win32Types.h: fixed-width Win32 scalars, pointer-sized handles, static_asserts
- Win32Crt.{h,cpp}: MSVC _snprintf truncation contract, stricmp, timeGetTime wrap
- port_logic static lib linked into libmtgodot; standalone MTGODOT_BUILD_PORT build
- port_header_gate: every port/**.h compiles alone (twice) with its lib's
  40250 Distribute|Win32 defines (NDEBUG, USE_LOD, _DISTRIBUTE)
- script/port_gate.sh: macOS/Android/iOS/Windows(mingw) PASS, Linux BLOCKED

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 19:57:58 +09:00
shenleiandClaude Opus 5 4521845a69 audit(2A): include-dependency tool, 2V0-2V3 slice unit lists and batch-2 order
port_deps.py resolves explicit #include edges plus the implicit edges each
40250 library's StdAfx.h supplies (symbol index restricted to StdAfx-visible
headers), writes cumulative slice lists and the P0 topological order.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 19:21:10 +09:00
shenandshen ae68ec5944 docs(port-plan): close migration prerequisite gaps 2026-09-22 03:01:57 -07:00
shenleiandClaude Opus 5 dcefc83211 docs(port-plan): add 2A/2R/2V prerequisites after plan review
- keep 40250 widths/overflow semantics (Win32 long = 32-bit), fixed-width
  serialized structs with static_assert, instead of copying C type names
- 2A base batch (types, header closure, port_logic target, platform stubs,
  header gate, port-map re-baseline) and include-order porting
- 2R pack inventory: six EPK compression types, HybridCrypt key source,
  index override order, path case, mobile delivery
- 2P: shared source list, per-platform pyconfig.h, all five platforms
- 2V minimal vertical slice; old and new paths coexist until wired
- strict asset tests (MT_ASSETS vs M2_ASSETS), RUN_AS_IS instead of N_A,
  void the 6 pre-architecture 'done' functions

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:38:04 +09:00
shenleiandClaude Opus 5 67a62e3390 docs(port-plan): data-source switch from m2dev assets to 40250 (batch 2D)
Records the root/uiscript/locale comparison: npclist, msm contents and
motion/combo registration match; msm location differs; item_proto and
mob_proto use a different record layout and TEA instead of XChaCha20,
so proto.cpp cannot read them; pack contents not yet compared.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:28:41 +09:00
shenleiandClaude Opus 5 184b631ce8 docs: PORT-PLAN.md as the single entry for the 40250 port route
Records the decisions (mirror-layout logic port, embedded CPython 2.7 UI),
layers and code layout, batch route and status, and the directory/toolchain
setup needed to resume on another machine. Marks the older refactor plan as
superseded and points CLAUDE.md/AGENTS.md/roadmap at it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:20:14 +09:00
shenleiandClaude Opus 5 b02c49bb2f spike(python): CPython 2.7.18 runs the 40250 root scripts on Android arm64
libpython2.7.a cross-builds with NDK 27.2 (API 24) after disabling
HAVE_LANGINFO_H; 30 C modules built in. On a OnePlus 13 (API 36) the
harness runs system.py -> prototype.RunApp() and imports the root modules
with results identical to macOS (66/74; the 8 failures are stub values or
dev-only scripts). py_embed_spike.py now isolates __main__ like
CPythonLauncher and reports stdlib usage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:16:44 +09:00
shenleiandClaude Opus 5 9d0e50de8f docs(parity): mirror 40250 layout for the logic layer; evaluate embedded Python UI
- SKILL.md: logic units port into extension/src/port/<Lib>/<File>, platform
  adapters under extension/src/platform; legacy GDScript owners are migration
  sources; python layer frozen until the embedding decision
- port_map.py: logic/python/platform layers with per-layer progress, queue
  --layer, LEGACY layout check; inventory adds EterBase, EterPythonLib,
  ScriptLib, SpeedTreeLib, SphereLib, EterImageLib
- py_embed_spike.py + docs/PYTHON-EMBED-EVAL.md: the 40250 system.py bootstrap
  loads 67/74 root modules unchanged under CPython 2.7 with stub natives

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:06:32 +09:00
shenleiandClaude Opus 5 a989b8f19b chore: delete 106 unreachable *_system.gd and their parity tests
These files were loaded only by their own test_*_parity.gd and never by
the runtime (transitively checked, incl. client_phase_integration_system).
Removes 76 manifest implementation/evidence references across 18
contracts; contract docs get a note that conclusions based on them are
void. Live systems kept: chest, consumable, item_attr, metin_socket,
whisper_chat.

Full headless suite: no new failures (7 failing + 5 headless-hanging
render tests are identical before the deletion).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 17:51:52 +09:00
shenleiandClaude Opus 5 5afd5a4f0d audit: refresh fingerprints after phase 0
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 17:17:54 +09:00
shenleiandClaude Opus 5 55f733fda6 audit: phase 0 tooling for file-by-file 40250 porting
- refroot.py: one reference-root resolver (MT_40250_SOURCE, then manifest)
  used by every audit script; missing tree or fingerprint input is an error
- port_map.py: per-function inventory of active 40250 units plus the
  40250 Python root, status/queue/init/show/check, 40250: tag scan
- manifest: fix 18 wrong reference paths (Python UI now points at the
  40250 Client/Eternexus/root, not the m2dev assets/root), drop 2 deleted
  implementation files, move 64 prose test entries to evidence.commands
- first port-map entry: PythonPlayerEventHandler.cpp
- roadmap replaced by a batch/unit queue

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 17:17:49 +09:00
shenleiandClaude Opus 5 6a175ee293 fix(movement): drop idle FUNC_WAIT resend with no 40250 counterpart
40250 only calls OnWaiting inside CInstanceBase::Transform() while
IsWalking() (InstanceBase.cpp:1922-1930); it never resends position
while standing. Remove _tick_on_waiting and its throttle state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 17:12:16 +09:00
shenleiandClaude Opus 5 ad6ea9ad7e skill: switch 40250 parity skill to file-by-file 1:1 porting
Unit of work is a 40250 source unit; current-only logic is a defect;
unreachable code is not evidence. Adds per-function port-map schema,
priority by player-visible gameplay, parallel worktree rules, and a
corrected project map.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 17:12:16 +09:00
shenleiandClaude Sonnet 5 c5c183da37 fix(movement): remove unreferenced [0.25,3.0] clamp on local player's movSpd scale
CInstanceBase::SetMoveSpeed only guards moving_speed > 1100 -> 0; the local
player's set_server_speed() was additionally floor/ceil-clamping the scale to
an arbitrary [0.25, 3.0] band with no basis in the reference or in this
project's already-fixed remote-entity equivalent (EntityStore::motion_move_speed).
A heavy haste stack or slow debuff on the local player would silently diverge
from what everyone else sees. Removed the extra clamp; kept the moving_speed<=0
early-return guard against pre-spawn/malformed values.

audit: movement.keyboard.motion/server-speed-scale-clamp closed with reference
citation, regression test, and full related-suite pass; contract stays PARTIAL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:31:17 +09:00
shenleiandClaude Sonnet 5 a4ac48db24 audit(movement.keyboard.motion): close Paralysis/Faint/Sleep gate as false positive
Investigated the prior round's flagged gap ("CanAct()'s Paralysis/Faint/Sleep
movement doors not wired into net_play.gd") via exhaustive reachability
tracing of the 40250 reference source. All three resolve to non-gaps:

- Paralysis: its only setter (__Shaman_SetParalysis, InstanceBaseEffect.cpp:821)
  has zero callers anywhere in the reachable source -- dead code, never true
  in live gameplay.
- Sleep: the AFFECT_SLEEP case in SetAffect() is commented out; the only live
  setter is the AFFECT_STUN case (SetSleep(), InstanceBaseEffect.cpp:932-933),
  i.e. IsSleep() is just an alias for AFFECT_STUN -- already covered by the
  existing `stunned` field and _can_process_network_state()'s dead/stunned/
  knock_down gate.
- Faint: only setter is chrFaintTest(), a debug-only Python binding operating
  on GetSelectedInstancePtr(); unverifiable from the available 40250 checkout
  (no root/ UI scripts) -- evidence-blocked, left unresolved per the skill's
  reachability rule.

Byproduct finding while tracing IsStun(): main-character GC_STUN routes to
Die() in the reference (RecvStunPacket), not Stun(); verified this causes no
movement.keyboard.motion discrepancy since CanAct() blocks movement equally
on IsDead()/IsStun() and the current client already blocks movement equally
on dead/stunned. The Die()-vs-Stun() distinction only affects death-system
semantics, already tracked under combat.affect-status.md (Remaining #2, rows
63/67) -- not duplicated here.

No implementation code changed. Removed the resolved item from manifest.json
and movement.keyboard-motion.md's Remaining list; documented full evidence
in the contract doc and remediation roadmap. Contract stays PARTIAL
(AccumulationMovement root-motion, OnMove/OnMoving event-source parity,
sync/hit/death/warp gate stacking, and real-model bone-flip test remain open
for future rounds).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:20:49 +09:00
shenleiandClaude Sonnet 5 7df97e01f9 fix(movement): camera auto-rotates to face WASD input direction
40250 parity: CPythonPlayer::NEW_MoveToDirection's m_isCmrRot branch
continuously rolls the camera toward the held movement direction every
frame while a direction key is down, independent of whether a new
translation target was just set. Add _camera_auto_rotate() to replicate
this (forward/back = no rotation, strafe = max rate, diagonal = half
rate), called unconditionally after the frozen/locked/shop/emotion gate
in _process(). Godot's yaw-increase handedness is opposite the
reference's D3D Roll(), so the sign is flipped as a platform adaptation;
verified by convergence invariants in keyboard_motion_timeline_test.gd
rather than bit-for-bit angle matching.

Closes movement.keyboard.motion/camera-auto-follow-rotation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:17:00 +09:00
shenandshen c93894313a fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧
- inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域
- 包含其他累积的功能开发和测试文件
2026-09-21 16:38:59 -07:00
shenandshen 1522a8a1a1 完善客户端功能并加入40250一致性审计 2026-09-21 16:38:58 -07:00
shenandshen 3eb001a1fd fix(ui): suppress native Godot tooltips to eliminate duplicate attribute panels 2026-09-19 20:01:57 -07:00
shenandshen 0dafa9f5ff 40250 classic: expand CHARACTER_NAME_MAX_LEN to 64 for full UTF-8 Chinese names 2026-09-19 19:50:40 -07:00
shenandshen 21462cddca fix(safebox): fix inventory_changed signal arg mismatch and optimize warp mob names 2026-09-19 19:33:16 -07:00
shenandshen 1637b500e5 fix(locale): resolve Chinese monster and NPC names via Locale.mob_names and early-bind name resolver 2026-09-19 19:19:55 -07:00
shenandshen 7cbda7b3dd feat(locale): add Locale fallback for monster names in net_play._entity_name 2026-09-19 18:58:10 -07:00
shenandshen 41772471d6 fix(locale): add missing tab and name for vnum 20035-20037 in mob_names.txt 2026-09-19 18:54:38 -07:00
shenandshen f872afb45f fix(locale): scope cur_lang across full setup in game_scene.gd 2026-09-19 18:49:17 -07:00
shenandshen 4a2b953a4f feat(locale): configure Chinese (zh) localization for client and align with 40250 server 2026-09-19 18:47:00 -07:00
shenandshen f22c0f8e31 feat(ui): 40250 item tooltip parity (thinboard, palette, sockets, stats) 2026-09-19 17:57:35 -07:00
shenandshen a834af873f fix(ui): 100% align NPC dialogue and shop popup panels with 40250 canonical UI layout and textures 2026-09-19 17:37:02 -07:00
shenandshen 5d43682498 fix(parity): implement ground click ripple, target select glow, and 3D projectile obstacle collision with regression probes 2026-09-19 17:01:50 -07:00
shenandshen 66d217b313 feat(client): 完成40250客户端核心功能1:1对齐与桥梁高度采样修复
- 桥梁与静态物体高度采样修复:
  - 严格对齐 40250 CMapOutdoor::GetHeight 与 CAttributeInstance::GetHeight
  - 解析 .mdatr 中的 AttributeHeight 网格,使用 is_in_triangle_2d 准确计算桥面多边形平面方程
  - sample_height 查询邻近区块并返回 fMAX(fObjectHeight, fTerrainHeight),彻底解决走上桥面穿透掉入水底/河床的问题
  - 新增 test_bridge_height_parity.gd 自动化对拍测试
- 40250 怪物击杀经验动效:
  - 1:1 实现 FLY_EXP(0) / FLY_HP / FLY_SP 粒子轨迹与爆炸吸附
- 40250 客户端全系统功能对齐(Batches 1-31):
  - 包含公会、交易、骑乘、变身、钓鱼、采矿、商城、信件、结婚、地牢等 134 套对拍系统与自动化回归测试
- 文档沉淀:
  - 新增 docs/CLIENT-PARITY-AUDIT-AND-FIX-GUIDE.md 客户端对拍缺陷发现与修复工程指南
2026-09-19 08:51:25 -07:00
shenlei 1db9e9a129 no message 2026-09-16 22:15:52 +09:00