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>
This commit is contained in:
shenlei
2026-09-23 01:34:08 +09:00
co-authored by Claude Opus 5
parent 5a26e93f07
commit 232d0461be
28 changed files with 1367 additions and 332 deletions
+4 -8
View File
@@ -488,10 +488,8 @@ func setup(m2client: Node, assets_root: String,
if ClassDB.class_exists("Metin2Proto") and assets_root != "":
proto = ClassDB.instantiate("Metin2Proto")
add_child(proto)
var ip := assets_root.path_join("locale/locale/%s/item_proto" % cur_lang)
if not FileAccess.file_exists(ip):
ip = assets_root.path_join("locale/locale/en/item_proto")
if FileAccess.file_exists(ip):
var ip := AssetRoot.locale_file("item_proto", cur_lang)
if ip != "":
proto.call("load_item_proto", ip)
# CPythonPlayer::IsEquipItemInSlot and SetItemData both consult the
# same ItemManager table. Share this authority with native senders so
@@ -505,10 +503,8 @@ func setup(m2client: Node, assets_root: String,
chat.set_proto(proto)
if quest_dialog and quest_dialog.has_method("set_proto"):
quest_dialog.set_proto(proto)
var mp := assets_root.path_join("locale/locale/%s/mob_proto" % cur_lang)
if not FileAccess.file_exists(mp):
mp = assets_root.path_join("locale/locale/en/mob_proto")
if FileAccess.file_exists(mp):
var mp := AssetRoot.locale_file("mob_proto", cur_lang)
if mp != "":
proto.call("load_mob_proto", mp)
await _yield()
net_play.proto = proto # 按 race 分类 NPC/怪(bType 在本 fork 不可靠)