Repository navigation
fix(bds-tools): BDS 更新检查优先使用 Mojang 官方下载接口 - #167
Merged
Merged
Conversation
- 版本号优先取自 Mojang 官方下载接口,失败再回退到 Bedrock-OSS 列表(GitHub raw / jsDelivr) - Bedrock-OSS 未收录新版本或不可达时,改用官方下载地址(跳过哈希校验) - 自定义 version_versions 或 endstone 模式行为不变 - httpRequest / httpDownload 在成功、重定向、4xx 后清除超时计时器,避免命令完成后空等至超时
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.
背景
服务器上 BDS 更新检查结果时新时旧:默认版本源 GitHub raw 在服务器网络不可达,只能依赖 jsDelivr 镜像,而 jsDelivr 缓存常落后于新版本。
改动
upstream.ts:getVersionInfo在 bedrock-oss 模式且未自定义version_versions时,先查 Mojang 官方下载接口(net-secondary.web.minecraft-services.net/api/v1.0/download/links,15 秒超时),失败或无对应条目则回退到原 Bedrock-OSS 列表逻辑(原重试逻辑不变)。check-update.ts:Bedrock-OSS 尚未收录该版本或不可达时,改用官方下载地址并告警(无哈希可校验);能取到详情时仍照常校验哈希。types.ts:VersionInfo增加可选downloadUrl。http.ts:httpRequest/httpDownload在成功、重定向、4xx 时也清除超时计时器(原先只在出错时清除,一次性命令完成后会空等至超时,默认 600 秒)。version_versions说明。@sfmc-bds/bds-tools、@sfmc-bds/sdkpatch。验证
bds-toolstypecheck、build 通过。getVersionInfo默认返回1.26.60.6与官方下载地址(约 200ms);自定义版本源时不查官方接口;脚本结束后进程正常退出。