Pierce01 / MinecraftLauncher-core

Lightweight module that downloads and runs Minecraft using javascript / NodeJS
MIT License
359 stars 82 forks source link

Fails to download com/typesafe dependencies properly for forge #26

Closed jaredallard closed 4 years ago

jaredallard commented 4 years ago

When running Minecraft Forge, libraries at com/typesafe/akka and com/typesafe/config are both being downloaded with the wrong URL. Instead of a jar being returned a 404 page is being returned:

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

I'd, at least, expect an error to be thrown instead of it silently failing.

I suspect this is due to some bug in the forge library download URL calculation. I'll go ahead and see if I can fix this, but that code looks decently complex so I'm not sure if I'll be able to fix it quickly.

Details

Minecraft Forge: 14.23.5.2847 Minecraft: 1.12.2

URLs:

Log of looking into this.

Running Wireshark against a new 1.12.2 install of forge to see what URL it's using (thanks for using HTTP by default forge....)

OK, found out it's checking for a .jar.pack.xz first, if THAT'S not found then it'll fallback to the .jar, but it looks like .jar.pack.xz is the only one that exists for what we want. We probably want to handle that and extract the file.

wireshark

Update: Turns out .pack.xz is some proprietary java bullshit, so working on figuring out how this will work. I don't really want to spend the next two weeks writing a node.js decompression package for this.

Another Update: unpack200 appears to be provided in the JRE, so verifying that bot linux and windows have this in their PATH, if so, I'll just child_process.spawn it.

Final update for the night: It is provided in the JRE, but for some reason it's not in PATH for windows, so going to figure that one out.

jaredallard commented 4 years ago

So I'm working on adding support for this, and it's super complicated. For some reason extracting via xz and then feeding that to unpack200 doesn't work, but yet doing all of that in a java implementation does work. So I think at this point I'll have to bundle some java code to get this working, but just damn.

Any thoughts @Pierce01? I hate this solution as well, but it's looking like the best one available to us...