From 2c429d0ec1aec0403e8d11912601cb801e2bfeac Mon Sep 17 00:00:00 2001 From: xingluo Date: Mon, 28 Apr 2025 01:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e581aa8..b06133b 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,55 @@ 1. **单次迁移模式** 跟随引导输入服务器路径、新旧UUID即可 -2. **批量处理模式** - 通过配置文件一次性处理多个UUID变更 +### 2. 批量处理模式 + +**适用场景** +同时处理多个玩家的UUID变更需求,适合大规模数据迁移 + +**操作流程** +1. **创建配置文件** + 新建`migration.json`文件,内容示例: + ```json + { + "path": "C:/你的服务器路径", + "mappings": { + "原UUID1": "新UUID1", + "原UUID2": "新UUID2" + } + } + ``` + +2. **填写配置信息** + - `path`: 填写你的服务器根目录绝对路径 + - `mappings`: 按`"旧UUID": "新UUID"`格式添加需要变更的对应关系 + +3. **执行迁移命令** + ```bash + python uuid_migrator.py --config migration.json + ``` + +**配置示例** +处理两位玩家的数据迁移: +```json +{ + "path": "C:/mc_server", + "mappings": { + "850c1551-a4af-4d56-88b5-2a041232be56": "1f06a2e9-fdc1-3392-80a2-b72ea9cd12f8", + "79f25117-0128-4329-86f7-618a8d983c82": "dda6094c-bc6b-3d53-b379-af7535d95c5d" + } +} +``` + +**效果说明** +程序将自动完成: +- 所有配置文件的UUID更新 +- 涉及模组数据的内容替换 +- 相关文件/目录的重命名操作 + +⚠️ **注意事项** +- 请使用纯文本编辑器创建配置文件 +- 路径请使用正斜杠`/`(兼容Windows/Linux) +- 确保所有UUID格式正确 ---