Closed JackGlobetrotter closed 1 month ago
Do you know if this is only the case for fabric servers? I think it could be a good idea to try and read the version as before and, on error, try the other approach.
This may allow for a broader fix. What do you think @JackGlobetrotter @gekigek99
I am not so familliar with other servers than fabric... to do this in "error handeling" might be a better solution yes!
@A-wels made some changes to preserve default methode and failover to default name only if there is an error, what do you think?
@gekigek99 Thanks for your reply, had a quick look at the code (as it has been a while). What fabric is doing: splitting the server.jar into two parts: fabric-server-launcher.jar
to start the server and versions\XXX\server-XXX.jar
for some classes, version info etc....
What my modification tries to do, without disrupting the already implemented workflow is:
letting the default version check run on the provided file (for fabric farbic-server-launcher.jar
), this fails as there is no version.json
file, then it fails over to versions\XXX\server-XXX.jar
where XXX is the provided version in msh-config.json
. The method calls itself (which is why the argument has the format altServerName ...string
, as to allow default empty params or the new path for fabric as param), now the method has the correct path to work with and reads ou the version.json
.
This modification was done upon @A-wels request to let the method run as per default and failover to the fabric-specific path only on error.
Sorry for the long reply.
PS: latest commit provides the universal path of fabric, previsous commit only adresses lagacy fabric server...
Thanks @JackGlobetrotter @A-wels for both the PR and explanation.
Hopefully you'll excuse me for late accept but I was focusing on university in the last months.
Don't say sorry for that. I know first hand that university can suck all time away. I hope that everything went well for you :)
Can relate to that, please don't be :) Thanks for accepting the PR.
Fabric uses
fabric-server-launch.jar
to start the server. This file does not contain the version.json. Instead theserver.jar
containing this file is located underversions/$VERSION/server-$VERSION.jar
. This PR corrects the path if Fabric is detected to read the correct file.