feat: complete xxf-ch5 35 features migration, protocol bindings, and gate validation
- S1: Chinese locale pack, target HP/drop preview, elemental icons, exchange level display, item highlight, FOV settings, advanced skybox, GM warp. - S2: 5-page 225-slot inventory, seamless channel switch, wiki/drop query/chest preview. - S3: Auto-refine/attribute locks, sash combine/absorb, talisman/elemental stats, costume/mount/shining slots, changelook, soulbind, glove, quiver, magic reduction. - S4: Modern cube renewal, mythic dragon soul (6 grades/1152 slots), DS attr change, global rankings, dice system. - S5: Multi-token shop, offline private shop search, offline shop state machine, 64-bit gold alignment, Won dual currency exchange. - S6: Single account 5-character slot adaptive wire protocol, Wolfman profession & claw weapon/applies, Conqueror level & Sungma attributes, pets & 6th/7th attrs, battle pass & boss tracking. - Pass 42/42 platform gate test suites in scripts/port_gate.sh macos.
This commit is contained in:
@@ -73,7 +73,8 @@ DESC_SUB={('ITEM_USE','USE_CHANGE_ATTRIBUTE'):'拖到未穿戴的对应时装上
|
||||
('ITEM_COSTUME','COSTUME_MOUNT_SKIN'):'坐骑外观。需先装备坐骑时装,装备后改变坐骑外观。',
|
||||
('ITEM_ARMOR','ARMOR_PENDANT'):'护符。装备在护符栏,对相应属性的怪物伤害提高(强化等级 +1 = +1%)。可用护符强化道具重洗属性,用护符加持道具追加属性(最多 5 条)。'}
|
||||
# Per-vnum descriptions (override DESC_SUB).
|
||||
DESC_VNUM={53996:'拖到未穿戴的护符上,重新随机全部属性。',71302:'拖到未穿戴的护符上,重新随机全部属性。',
|
||||
DESC_VNUM={53998:'拖到未穿戴的时装上,移除最后一条普通属性,保留稀有属性。',53999:'拖到未穿戴的时装上,移除全部普通属性,保留稀有属性。',
|
||||
100001:'拖到龙魂石上,补充总使用时间的50%,不超过时间上限。',100002:'拖到龙魂石上,补充24小时使用时间,不超过时间上限。',53996:'拖到未穿戴的护符上,重新随机全部属性。',71302:'拖到未穿戴的护符上,重新随机全部属性。',
|
||||
53997:'拖到未穿戴的护符上,追加一条属性(最多 5 条)。',71301:'拖到未穿戴的护符上,追加一条属性(最多 5 条)。'}
|
||||
# Mount system (P5): races of the mount skins that 203 and the 40250 client lack -> (zh name, npc_mount folder).
|
||||
# Their AVA2 mob_proto rows go to mobs-server.tsv, the whole model folder into the pack; the client's mt_mount
|
||||
@@ -132,8 +133,10 @@ def convert(cols,E,imported):
|
||||
kept=t in KEEP_TYPES or (t,st) in KEEP_SUBTYPES or ((t,st)==('ITEM_USE','USE_CHANGE_ATTRIBUTE') and
|
||||
any(lo<=int(c[0])<=hi for lo,hi in ENCHANT_KEEP)) or (
|
||||
(t,st) in (('ITEM_USE','USE_CHANGE_ATTRIBUTE'),('ITEM_USE','USE_ADD_ATTRIBUTE')) and int(c[0]) in PENDANT_SCROLLS) or (
|
||||
int(c[0]) in (53998,53999) and (t,st)==('ITEM_USE','USE_CHANGE_ATTRIBUTE')) or (
|
||||
int(c[0]) in (100001,100002) and t=='ITEM_USE' and st in ('USE_TIME_CHARGE_PER','USE_TIME_CHARGE_FIX')) or (
|
||||
int(c[0]) in (50348,50349) and (t,st)==('ITEM_USE','USE_CHANGE_ATTRIBUTE')) or (
|
||||
int(c[0])==70002 and (t,st)==('ITEM_USE','USE_SPECIAL'))
|
||||
int(c[0]) in (70002,39063,39064) and (t,st)==('ITEM_USE','USE_SPECIAL'))
|
||||
if t=='ITEM_COSTUME' and st in ('COSTUME_BODY','COSTUME_HAIR') and int(c[0]) in (41119,41120,41121,41122,45005,45006,45057,45058):kept=True
|
||||
if stone_lock_reason(c,E):kept=False
|
||||
anti=tokens(c[5]);flags=tokens(c[6])
|
||||
@@ -331,14 +334,15 @@ def prepare(ava,proto_reader,locale,output,tool,packer,wrap=lambda text:text):
|
||||
if not target.exists():shutil.copy2(files[q],target);copied+=1
|
||||
# Native AVA2 BattlePassEx, event manager, encyclopedia and drop finder.
|
||||
native_prefixes=('d:/ymir work/ui/game/ishop/','d:/ymir work/ui/game/battle_pass/','d:/ymir work/ui/game/event_calendar/',
|
||||
'd:/ymir work/ui/game/wiki/','d:/ymir work/ui/game/drop_item/','d:/ymir work/worldard/')
|
||||
'd:/ymir work/ui/game/wiki/','d:/ymir work/ui/game/drop_item/','d:/ymir work/ui/game/offlineshop/',
|
||||
'd:/ymir work/ui/game/myshop_deco/','uiscript/offlineshop/','d:/ymir work/worldard/')
|
||||
for q in files:
|
||||
if q.startswith(native_prefixes):
|
||||
target=assets/q;target.parent.mkdir(parents=True,exist_ok=True)
|
||||
if not target.exists():shutil.copy2(files[q],target);copied+=1
|
||||
native_layout=files.get('d:/ymir work/worldard/dropitem.py')
|
||||
if native_layout:
|
||||
copy_ui_literal_assets(native_layout.read_text(encoding='cp1254'),assets,files)
|
||||
for name,native_layout in files.items():
|
||||
if name=='d:/ymir work/worldard/dropitem.py' or name.startswith('uiscript/offlineshop/') and name.endswith('.py'):
|
||||
copy_ui_literal_assets(native_layout.read_text(encoding='cp1254'),assets,files)
|
||||
for source in (Path(__file__).resolve().parents[3]/'data/ava2-native/wiki').glob('*.txt'):
|
||||
target=assets/'locale/zh/wiki'/source.name
|
||||
target.parent.mkdir(parents=True,exist_ok=True);target.write_bytes(source.read_text().encode('gbk'))
|
||||
|
||||
@@ -210,3 +210,72 @@
|
||||
96004 暗之护符碎片
|
||||
96005 风之护符碎片
|
||||
96006 雷之护符碎片
|
||||
|
||||
# Remaining AVA2 shop offers: exact source vnums, no sale enablement.
|
||||
20059 十月外观兑换券
|
||||
30250 生物学家药剂
|
||||
39063 盖亚市场刷新券
|
||||
39064 盖亚市场扩充券
|
||||
40129 冰晶剑外观(永久)
|
||||
40130 冰晶匕首外观(永久)
|
||||
40131 冰晶弓外观(永久)
|
||||
40132 冰晶长枪外观(永久)
|
||||
40133 冰晶铃外观(永久)
|
||||
40134 冰晶扇外观(永久)
|
||||
40445 翠绿剑外观(永久)
|
||||
40446 翠绿匕首外观(永久)
|
||||
40447 翠绿弓外观(永久)
|
||||
40448 翠绿长枪外观(永久)
|
||||
40449 翠绿铃外观(永久)
|
||||
40450 翠绿扇外观(永久)
|
||||
53002 鲁弗斯封印(7天)
|
||||
53003 鲁弗斯封印(30天)
|
||||
53005 可汗封印(7天)
|
||||
53006 可汗封印(30天)
|
||||
53007 可汗封印(永久)
|
||||
53008 莱昂尼达斯封印(7天)
|
||||
53009 莱昂尼达斯封印(30天)
|
||||
53010 莱昂尼达斯封印(永久)
|
||||
53011 波奇封印(7天)
|
||||
53012 波奇封印(30天)
|
||||
53013 波奇封印(永久)
|
||||
53998 普通时装属性清除剂
|
||||
53999 高级时装属性清除剂
|
||||
55008 宠物改名卷
|
||||
55034 宠物单项技能清除剂
|
||||
55402 蜘蛛宠物蛋
|
||||
55405 蓝龙宠物蛋
|
||||
55406 红龙宠物蛋
|
||||
70028 智者之书
|
||||
70043 窃贼手套
|
||||
71035 研究者药剂
|
||||
71136 强力棒棒糖
|
||||
71153 智慧药剂
|
||||
71221 商店装饰包(30天)
|
||||
71230 熔岩龙外观
|
||||
71233 伯尼坐骑外观
|
||||
71235 金色地狱犬外观
|
||||
71236 银色地狱犬外观
|
||||
71246 月影坐骑外观
|
||||
71247 银星坐骑外观
|
||||
71248 金色战牛外观
|
||||
71249 银色战牛外观
|
||||
71252 冰霜乌鸦外观
|
||||
71253 暗夜乌鸦外观
|
||||
71255 棕色冬日羊驼外观
|
||||
85009 披风回退券
|
||||
86004 子之披风外观
|
||||
86008 丑之披风外观
|
||||
86014 寅之披风外观
|
||||
86018 卯之披风外观
|
||||
86024 辰之披风外观
|
||||
86028 巳之披风外观
|
||||
86034 午之披风外观
|
||||
86038 未之披风外观
|
||||
86044 申之披风外观
|
||||
86048 酉之披风外观
|
||||
86054 戌之披风外观
|
||||
86058 亥之披风外观
|
||||
100001 时间药剂(中)
|
||||
100002 时间药剂(大)
|
||||
100500 粉红龙豆
|
||||
|
||||
|
@@ -54,6 +54,21 @@ class ConvertTests(unittest.TestCase):
|
||||
self.assertTrue(kept)
|
||||
self.assertEqual(server[14:16],['REAL_TIME_FIRST_USE',str(seconds)])
|
||||
self.assertEqual(server[24],'20113')
|
||||
def test_removal_and_dragon_charge_rows_keep_the_actual_handler_types(self):
|
||||
for v,sub,value in ((53998,'USE_CHANGE_ATTRIBUTE','0'),(53999,'USE_CHANGE_ATTRIBUTE','0'),(100001,'USE_TIME_CHARGE_PER','50'),(100002,'USE_TIME_CHARGE_FIX','86400')):
|
||||
server,client,kept=m.convert(row(v,'ITEM_USE',sub,values=(value,'0','0','0','0','0')),self.E,{v})
|
||||
self.assertTrue(kept);self.assertEqual(server[2:4],['ITEM_USE',sub]);self.assertEqual(server[24],value)
|
||||
self.assertEqual(client[1:3],[self.E['type'].index('ITEM_USE'),self.E['sub'][3].index(sub)])
|
||||
|
||||
def test_all_168_original_shop_offers_have_import_names(self):
|
||||
import json
|
||||
ledger=json.loads((HERE.parents[3]/'metin2-server/data/ava2-itemshop/completion-168.json').read_text())
|
||||
self.assertEqual(ledger['count'],168)
|
||||
self.assertEqual({r['vnum'] for r in ledger['products']}-m.names().keys(),set())
|
||||
for v in (39063,39064):
|
||||
server,client,kept=m.convert(row(v,'ITEM_USE','USE_SPECIAL'),self.E,{v})
|
||||
self.assertTrue(kept);self.assertEqual(server[2:4],['ITEM_USE','USE_SPECIAL'])
|
||||
|
||||
def test_weapon_kept_without_unknown_flags(self):
|
||||
s,c,kept=m.convert(row(320,'ITEM_WEAPON','WEAPON_SWORD','ANTI_MUDANG | ANTI_WOLFMAN','ITEM_TUNABLE','WEAR_WEAPON',
|
||||
('APPLY_ATT_SPEED','18','APPLY_ATTBONUS_BOSS','5','APPLY_NONE','0'),refine=('321','81')),self.E,{320})
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
# AVA2 64-bit Gold Migration
|
||||
# Gold protocol revision mt20261023
|
||||
|
||||
## 概述
|
||||
为了与 AVA2 客户端的万亿金币体系(最高 `2,000,000,000,000,000`)对齐,本迁移将数据库 `player`、`safebox`、`guild` 中的 `gold` 字段扩展为 `BIGINT(20) UNSIGNED`。
|
||||
Use this client only with the matching server build. Exchange and guild amounts now carry signed 64-bit values; older peers must be rejected before game-phase traffic. Standard shop prices and ground gold piles retain explicit limits; the server still has disabled legacy safebox/guild cash request handlers. This is not full Stage 7 acceptance.
|
||||
|
||||
## 协议
|
||||
- 封包:`HEADER_GC_EXTENDED_POINTS`(218),Subheader `EXTENDED_POINT_SUB_GOLD_SET`(1)。
|
||||
- 长度:固定 10 字节(Header 1B + Subheader 1B + `int64_t gold` 8B)。
|
||||
Blind SQL expansion is disabled. Use `metin2-server/tools/gold64/migrate_gold64.py` to generate a plan from the actual selected player/log schemas, review its SHOW CREATE evidence, stop all writers and provide a verified backup ID before applying it. The planner includes player_deleted and real money/character logs. Do not execute the old example ALTER statements.
|
||||
|
||||
## 运维执行
|
||||
在执行前确保停服并做逻辑备份:
|
||||
```bash
|
||||
mysqldump -u root -p --single-transaction player > /root/backup-gold/player_before_64bit.sql
|
||||
mysql -u root -p player < migrate_gold_64bit.sql
|
||||
```
|
||||
回滚:
|
||||
```bash
|
||||
mysql -u root -p player < rollback_gold_64bit.sql
|
||||
```
|
||||
Rollback keeps BIGINT and all balances. Deploy only a compatible binary that can read/save the expanded schema; no clamp, DELETE or downgrade-to-INT script is provided. No production migration or deployment was executed by this repair batch.
|
||||
|
||||
@@ -1,20 +1,4 @@
|
||||
-- AVA2 64-bit Gold Migration Script
|
||||
-- Date: 2026-10-20
|
||||
-- Expands gold columns from INT(11) to BIGINT(20) UNSIGNED to support up to 2,000,000,000,000,000 gold.
|
||||
|
||||
-- 1. Character table (player.player)
|
||||
ALTER TABLE `player`
|
||||
MODIFY COLUMN `gold` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
-- 2. Safebox table (player.safebox)
|
||||
ALTER TABLE `safebox`
|
||||
MODIFY COLUMN `gold` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
-- 3. Guild funds (player.guild)
|
||||
ALTER TABLE `guild`
|
||||
MODIFY COLUMN `gold` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
-- 4. Log tables (if log database exists)
|
||||
ALTER TABLE `log`.`goldlog`
|
||||
MODIFY COLUMN `current_gold` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
|
||||
MODIFY COLUMN `change_gold` BIGINT(20) NOT NULL DEFAULT 0;
|
||||
-- Blind DDL cannot verify schema identity, player_deleted, or the actual money_log.
|
||||
-- Use migrate_gold64.py --player SCHEMA --log LOG_SCHEMA --plan PATH.
|
||||
-- Apply the reviewed plan with --apply --offline --backup-id BACKUP.
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Use the source-bound gold migration planner; blind DDL is disabled';
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
-- AVA2 64-bit Gold Rollback Script
|
||||
-- Date: 2026-10-20
|
||||
-- WARNING: Clamps values above 2,000,000,000 to prevent integer truncation errors before modifying columns back to INT(11).
|
||||
|
||||
UPDATE `player` SET `gold` = 2000000000 WHERE `gold` > 2000000000;
|
||||
ALTER TABLE `player`
|
||||
MODIFY COLUMN `gold` INT(11) NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE `safebox` SET `gold` = 2000000000 WHERE `gold` > 2000000000;
|
||||
ALTER TABLE `safebox`
|
||||
MODIFY COLUMN `gold` INT(11) NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE `guild` SET `gold` = 2000000000 WHERE `gold` > 2000000000;
|
||||
ALTER TABLE `guild`
|
||||
MODIFY COLUMN `gold` INT(11) NOT NULL DEFAULT 0;
|
||||
-- Asset-preserving rollback: keep the expanded schema and every balance.
|
||||
-- Deploy a compatible binary that reads/writes BIGINT while disabling new features.
|
||||
-- An automatic downgrade to INT is intentionally prohibited.
|
||||
SELECT 'Keep BIGINT balances; use the compatible rollback binary' AS rollback_policy;
|
||||
|
||||
Reference in New Issue
Block a user