diff --git a/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg b/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg new file mode 100644 index 0000000..69d6f92 --- /dev/null +++ b/LaunchServer/resources/launchserver/defaults/profile1.5.2.cfg @@ -0,0 +1,40 @@ +version: "1.5.2"; +assetIndex: "---"; # 1.7.10+ only + +# Runtime-dependent params +dir: "XXXXX"; +assetDir: "asset1.5.2"; + +# Client params +sortIndex: 0; +title: "XXXXX"; +serverAddress: "server.tld"; +serverPort: 25565; + +# Updater and client watch service +update: [ + "servers\\.dat" +]; +updateVerify: [ + "libraries", "natives", "mods", "minecraft\\.jar" +]; +updateExclusions: []; + +# Client launcher params +mainClass: "net.minecraft.launchwrapper.Launch"; +classPath: [ "minecraft.jar", "libraries" ]; +jvmArgs: [ + # Some options from Mojang's launcher + "-XX:+UseConcMarkSweepGC", + "-XX:+CMSIncrementalMode", + "-XX:-UseAdaptiveSizePolicy", + "-Xmn128M", + + # JVM Attach protection + "-XX:+DisableAttachMechanism", + + # Legacy bridge (for 1.6.4 & lower) settings + "-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png", + "-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png" +]; +clientArgs: []; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg b/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg index e4da9fd..9f49f5c 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.6.4.cfg @@ -19,11 +19,7 @@ "libraries", "natives", "mods", "minecraft\\.jar", "forge\\.jar", "liteloader\\.jar" ]; -updateExclusions: [ - # "mods/carpentersblocks", - # "mods/ic2", - # "mods/railcraft" -]; +updateExclusions: []; # Client launcher params mainClass: "net.minecraft.launchwrapper.Launch"; diff --git a/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg b/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg index d080f35..55eca61 100644 --- a/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg +++ b/LaunchServer/resources/launchserver/defaults/profile1.7.2.cfg @@ -19,11 +19,7 @@ "libraries", "natives", "mods", "minecraft\\.jar", "forge\\.jar", "liteloader\\.jar" ]; -updateExclusions: [ - # "mods/carpentersblocks", - # "mods/ic2", - # "mods/railcraft" -]; +updateExclusions: []; # Client launcher params mainClass: "net.minecraft.launchwrapper.Launch"; diff --git a/Launcher/source/client/ClientLauncher.java b/Launcher/source/client/ClientLauncher.java index 499f0c7..7a95e22 100644 --- a/Launcher/source/client/ClientLauncher.java +++ b/Launcher/source/client/ClientLauncher.java @@ -273,7 +273,13 @@ } private static void addClientLegacyArgs(Collection args, ClientProfile profile, Params params) { - // TODO + args.add(params.pp.username); + args.add(params.accessToken); + + // Add args for tweaker + Collections.addAll(args, "--version", profile.getVersion().name); + Collections.addAll(args, "--gameDir", params.clientDir.toString()); + Collections.addAll(args, "--assetsDir", params.assetDir.toString()); } private static void launch(ClientProfile profile, Params params) throws Throwable { @@ -303,11 +309,10 @@ LAUNCHED.set(true); JVMHelper.fullGC(); try { + System.setProperty("minecraft.applet.TargetDirectory", params.clientDir.toString()); // For 1.5.2 mainMethod.invoke(null, (Object) args.toArray(new String[args.size()])); } catch (InvocationTargetException e) { throw e.getTargetException(); - } finally { - LAUNCHED.set(false); } } diff --git a/Launcher/source/helper/CommonHelper.java b/Launcher/source/helper/CommonHelper.java index 540eb95..8a7d426 100644 --- a/Launcher/source/helper/CommonHelper.java +++ b/Launcher/source/helper/CommonHelper.java @@ -8,7 +8,6 @@ public final class CommonHelper { private static final String[] SCRIPT_ENGINE_ARGS = { "-strict" }; - private static final NashornScriptEngineFactory SCRIPT_ENGINE_FACTORY = new NashornScriptEngineFactory(); private CommonHelper() { } @@ -20,7 +19,7 @@ @LauncherAPI public static ScriptEngine newScriptEngine() { - return SCRIPT_ENGINE_FACTORY.getScriptEngine(SCRIPT_ENGINE_ARGS); + return new NashornScriptEngineFactory().getScriptEngine(SCRIPT_ENGINE_ARGS); } @LauncherAPI diff --git a/build.sh b/build.sh index f32ef95..77c9bea 100644 --- a/build.sh +++ b/build.sh @@ -8,17 +8,17 @@ echo 'Packing Launcher.jar binary' zip -9 Launcher.jar buildnumber pack200 -E9 -Htrue -mlatest -Uerror -r Launcher.jar -jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER Launcher.jar sashok724 > /dev/null +jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER Launcher.jar sashok724 pack200 Launcher.pack.gz Launcher.jar # Build LauncherAuthlib.jar echo 'Packing LauncherAuthlib.jar binary' pack200 -E9 -Htrue -mlatest -Uerror -r LauncherAuthlib.jar -jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LauncherAuthlib.jar sashok724 > /dev/null +jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LauncherAuthlib.jar sashok724 # Build LaunchServer.jar echo 'Packing LaunchServer.jar binary' zip -9 LaunchServer.jar Launcher.pack.gz buildnumber pack200 -E9 -Htrue -mlatest -Uerror -r LaunchServer.jar -jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LaunchServer.jar sashok724 > /dev/null +jarsigner -keystore build/sashok724.jks -storepass PSP1004 -sigfile LAUNCHER LaunchServer.jar sashok724 rm Launcher.pack.gz diff --git a/compat/BungeeCord.patch b/compat/BungeeCord.patch index 481ac3e..80a425f 100644 --- a/compat/BungeeCord.patch +++ b/compat/BungeeCord.patch @@ -1,11 +1,13 @@ diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml -index 48f56b3..238ab60 100644 +index 5c42c6f..2f5ac13 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml -@@ -58,6 +58,7 @@ +@@ -57,7 +57,8 @@ + - net.md_5.bungee.Bootstrap +- net.md_5.bungee.Bootstrap ++ net.md_5.bungee.Bootstrap + Launcher.jar ${describe} ${maven.build.timestamp} @@ -15,7 +17,7 @@ --- a/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java +++ b/bootstrap/src/main/java/net/md_5/bungee/Bootstrap.java @@ -5,9 +5,9 @@ public class Bootstrap - + public static void main(String[] args) throws Exception { - if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 ) @@ -27,23 +29,21 @@ return; } diff --git a/pom.xml b/pom.xml -index 7ebde38..b327a25 100644 +index 7f9564c..1d04d57 100644 --- a/pom.xml +++ b/pom.xml -@@ -65,9 +65,9 @@ - +@@ -67,8 +67,8 @@ unknown -- 4.0.33.Final + 4.1.6.Final - 1.7 - 1.7 -+ 4.0.37.Final + 1.8 + 1.8 UTF-8 - -@@ -96,6 +96,13 @@ + +@@ -97,6 +97,13 @@ 1.14.8 provided @@ -55,9 +55,9 @@ + /full/path/to/Launcher.jar + - + -@@ -116,31 +123,6 @@ +@@ -117,31 +124,6 @@ @@ -90,20 +90,29 @@ org.apache.maven.plugins diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -index bcc6f9a..7829b8b 100644 +index d87b03c..08efeb4 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -@@ -60,6 +60,9 @@ import net.md_5.bungee.protocol.packet.StatusRequest; +@@ -63,6 +63,9 @@ import net.md_5.bungee.protocol.packet.StatusRequest; import net.md_5.bungee.protocol.packet.StatusResponse; import net.md_5.bungee.util.BoundedArrayList; - + +import launcher.client.PlayerProfile; +import launcher.request.auth.CheckServerRequest; + @RequiredArgsConstructor public class InitialHandler extends PacketHandler implements PendingConnection { -@@ -383,35 +386,25 @@ public class InitialHandler extends PacketHandler implements PendingConnection +@@ -262,7 +265,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection + this.handshake = handshake; + ch.setVersion( handshake.getProtocolVersion() ); + +- // Starting with FML 1.8, a "\0FML\0" token is appended to the handshake. This interferes ++ // Starting with FML 1.8, a "\0FML\0" token is appended to the handshake. This interferes + // with Bungee's IP forwarding, so we detect it, and remove it from the host string, for now. + // We know FML appends \00FML\00. However, we need to also consider that other systems might + // add their own data to the end of the string. So, we just take everything from the \0 character +@@ -403,35 +406,25 @@ public class InitialHandler extends PacketHandler implements PendingConnection { sha.update( bit ); } @@ -142,7 +151,7 @@ } - } - }; - + - HttpClient.get( authURL, ch.getHandle().eventLoop(), handler ); + // Successful login + loginProfile = new LoginResult(pp); @@ -154,7 +163,7 @@ + } + }); } - + private void finish() diff --git a/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java b/proxy/src/main/java/net/md_5/bungee/connection/LoginResult.java index 9311ef7..98bba42 100644 @@ -163,7 +172,7 @@ @@ -3,6 +3,17 @@ package net.md_5.bungee.connection; import lombok.AllArgsConstructor; import lombok.Data; - + +import java.net.URL; +import java.io.IOException; +import java.io.FileNotFoundException; @@ -181,7 +190,7 @@ @@ -11,6 +22,20 @@ public class LoginResult private String id; private Property[] properties; - + + public LoginResult(PlayerProfile pp) { + id = ClientLauncher.toHash(pp.uuid); + List properitesList = new ArrayList<>(4);