Repository navigation
修复服务器整合包实例「更新整合包」填入 server-manifest.json 地址时报「HMCL 不支持该整合包格式」 - #7382
Open
luochen1990 wants to merge 1 commit into
Open
luochen1990 wants to merge 1 commit into
luochen1990 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7381.
问题
服务器整合包实例上「更新整合包」→「从互联网下载整合包」→ 填入远程
server-manifest.json地址时,向导能正常下载并解析 manifest、正确显示名称/版本/作者,但点击安装后报「HMCL 不支持该整合包格式」。ModpackInstallWizardProvider#finishModpackInstallingAsync的更新流程中,if (selected == null)守卫位于serverModpackManifest != null分支之前。远程 manifest 形态没有本地文件,selected恒为 null(ModpackSelectionPage#onChooseRemoteFile的 server-manifest 分支只写MODPACK_SERVER_MANIFEST,不写MODPACK_FILE),守卫先命中,远程更新分支不可达。85c01cd(#747 的修复)引入该分支时,上方的守卫未同步调整。完整分析见 #7381。修复
守卫条件改为
if (selected == null && serverModpackManifest == null)。方法开头已有同一条件的空值检查并提前返回,因此该守卫在此处恒为假,直接删除这几行是等价的;本次为保持最小改动先保留,如倾向删除我可以调整。目标实例不是服务器整合包(configuration.getType()不匹配)时,仍由getUpdateTask抛出的UnsupportedModpackException走同一个「HMCL 不支持该整合包格式」弹窗。本地文件更新路径(selected != null)行为不变。测试
./gradlew :HMCL:compileJava通过。ModpackHelper.getUpdateTask(…, ServerModpackManifest, …)重载在全仓仅此一处调用,修复后才首次经 UI 可达,其运行时行为尚无实测覆盖;如需我补测请告知。