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:
shen
2026-10-22 01:29:14 -07:00
parent 867633667f
commit 846a993183
345 changed files with 48463 additions and 326 deletions
+4 -16
View File
@@ -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.
+4 -20
View File
@@ -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;