对versionManifest.json和version.json的解析 #32
Closed
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.
version manifest.json是用于查询版本信息的清单文件,供启动器查询所有版本的信息并下载version.json文件
version.json是用于查询单个版本信息的清单文件,供启动器下载某个特定的游戏版本。
存储的实体类过长,这里不作说明,和对应的json文件内容保持一致(可能有部分出入,建议使用时配合源代码)
version.json的解析器入口在
PCL2.Neo.Models.Minecraft.McVersion.VersionFileParser.Parer()
,为public static VersionData.VersionData Parser(string input)
。其中传入参数input为文件的内容,可以使用System.IO.File.ReadAllText()
获取。在调用后会返回VersionData,用来访问解析后的数据(就像使用了JsonSerializer.Deserialize一样)