-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupted versions #121
Comments
Also, I can upload these corrupted .json files if you want. |
I didn't really know about Something like: import { Diagnosis } from "@xmcl/core";
const minecraftLocation: string;
const minecraftVersionId: string;
const report: Diagnosis.MinecraftIssueReport = await Diagnosis.diagnose(minecraftLocation, minecraftVersionId);
const issues: Diagnosis.MinecraftIssues[] = report.issues;
(async () => {
let fixed = [];
if (issues.length > 1) {
fixed = issues.map( issue => issue.fix() );
}
await Promise.all(fixed);
})();
console.log('done!'); |
Thanks for you investigation! You can upload the "corrupted" .json file, and I think I will support that format this format (since official launcher supports it). About the issue fixing, the problem is the |
After investigating a little bit, I found out that official Minecraft launcher doesn't actually see these corrupted versions that were generated by custom Minecraft launcher that I'm using. The versions I did in fact see in official Minecraft launcher were versions generated by other tools - Forge, OptiFine, LiteLoader and some cheat-clients (yeah...). I don't really think you should support custom [version].json formats that official Minecraft launcher doesn't support. Versions that were generated by tools seem to be parsed correctly by your package. The only problem I have is that these versions need to be reinstalled to get them working. Otherwise, I get either So yeah, seems like fully reinstalling versions is the only way to deal with corrupted versions. Thanks for your great package! |
Do you mean when you try to launch the version, you got the errors launch({ ...otherOptions, prechecks: [] }); // pass empty array to precheck Empty precheck will do nothing before the launch. Maybe you want to still perform the launch({ ...otherOptions, prechecks: [LaunchPrecheck.checkNatives] }); // only extract natives |
New issue appeared: When I try to launch this version after some time it tries to locate I don't really see why should I reinstall this version - it isn't corrupted, it's just missing some libraries, but as I said I can't detect these missing libraries using your packages. But right now I think it's the only way of solving this issue... |
Actually, the library can have size -1, as not all library providers provide the library size, or sha1. Let me double check what happens to the liteloader... |
Actually, I cannot repro this bug... I've tried to reinstall and launch with liteloader but it seems all fine... |
It seems that parsing versions installed by custom Minecraft launchers is broken.
I installed my versions using custom Minecraft launcher -- TLauncher, but I couldn't get them to work with
@xmcl/core
. When I try to parse them - they either throwCorruptedVersionJson
,CorruptedVersionJar
orMissingLibrary
error. But that's really strange -- I can successfully see them in official Minecraft launcher (I didn't test launching them, but isn't seeming them in Minecraft launcher enough?)I investigated into this issue a little bit, and found out that the structure of [version].json is indeed different to the one you are checking.
minecraft-launcher-core-node/packages/core/version.ts
Lines 507 to 513 in d1618d7
When checking for native libraries -- you depend on
classifiers
object ofdownloads
. In my ''corrupted'' [version].json these native libraries don't havedownloads
parameter, but instead haveclassifies
(not classifiers) and artifacts in the root object of library.TL;DR: You test for this structure of native library:
But in my "corrupted" [version].json I have this structure:
Which is really strange. Is this a strange spaghetti code of custom Minecraft launcher, or does official Minecraft launcher implement different structures of native libraries [and custom Minecraft launcher uses a different structure than yours]?
But my main question isn't about all of this. My main question is: How can I resolve these versions or fix this issue?
My two options are:
If I reinstall these corrupted versions, will their settings reset? Will my users even notice it?
Is reinstalling other launchers' versions even good -- what if they stop working after I install different [version].json? Is this even a good decision design-wise?
I'm pretty stuck with this issue. Please help :)
The text was updated successfully, but these errors were encountered: