From f58d387d9255b55259c18bc61f432477294558b1 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 24 Dec 2018 14:58:28 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20DownloadClientCommand=20=D0=B8=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B5=D0=B9=201.1?= =?UTF-8?q?2.2=20=D0=B8=201.7.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/basic/TestCommand.java | 2 +- .../command/hash/DownloadClientCommand.java | 1 + .../launchserver/defaults/profile1.12.2.cfg | 73 ++++++++----------- .../launchserver/defaults/profile1.7.10.cfg | 73 +++++++------------ .../launcher/profiles/ClientProfile.java | 4 + 5 files changed, 66 insertions(+), 87 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java index 16c359d7..6e70173b 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java @@ -36,7 +36,7 @@ public void invoke(String... args) throws Exception { CommonHelper.newThread("Netty Server", true, handler).start(); } if (args[0].equals("profile")) { - ClientProfile profile = new ClientProfile("1.7.10","asset1.7.10",0,"Test1.7.10","localhost",25535,true,false,"net.minecraft.launchwrapper.Launch"); + ClientProfile profile = new ClientProfile("1.7.10","asset1.7.10",0,"Test1.7.10","localhost",25565,true,false,"net.minecraft.launchwrapper.Launch"); try(Writer writer = IOHelper.newWriter(LaunchServer.server.dir.resolve("profiles").resolve("Test.cfg"))) { Launcher.gson.toJson(profile,writer); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/hash/DownloadClientCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/hash/DownloadClientCommand.java index d44b2c07..7b3fb300 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/hash/DownloadClientCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/hash/DownloadClientCommand.java @@ -56,6 +56,7 @@ public void invoke(String... args) throws IOException, CommandException { client = Launcher.gson.fromJson(reader,ClientProfile.class); } client.setTitle(dirName); + client.setDir(dirName); try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir, dirName, "cfg"))) { Launcher.gson.toJson(client,writer); diff --git a/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.12.2.cfg b/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.12.2.cfg index 9a0963ff..aaf069d5 100644 --- a/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.12.2.cfg +++ b/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.12.2.cfg @@ -1,50 +1,41 @@ -version: "1.12.2"; -assetIndex: "1.12.2"; # 1.7.10+ only - -# Runtime-dependent params -dir: "XXXXX"; -assetDir: "asset1.12"; - -# Client params -sortIndex: 0; -title: "XXXXX"; -serverAddress: "server.tld"; -serverPort: 25565; - -# Updater and client watch service -updateFastCheck: true; -update: [ - "servers.dat" -]; -updateVerify: [ - "libraries", "natives", "mods", - "minecraft.jar", "forge.jar", "liteloader.jar" -]; -updateExclusions: []; -updateShared: []; -updateOptional: []; -enabledOptional: []; - -useWhitelist: false; -whitelist: []; - -# Client launcher params -mainClass: "net.minecraft.launchwrapper.Launch"; -classPath: [ "forge.jar", "liteloader.jar", "minecraft.jar", "libraries" ]; -jvmArgs: [ +{ + "version": "1.12.2", + "assetIndex": "1.12.2", + "assetDir": "asset1.12", + "dir": "HiTech", + "sortIndex": 0, + "title": "xxxxxxxx", + "serverAddress": "localhost", + "serverPort": 25565, + "update": ["servers.dat"], + "updateExclusions": [ + "mods/OpenSecurity", + "mods/VoxelMods", + "mods/railcraft" + ], + "updateShared": [], + "updateVerify": [ + "libraries", "natives", "mods", + "minecraft.jar", "forge.jar", "liteloader.jar" + ], + "updateOptional": [ + ], + "updateFastCheck": true, + "useWhitelist": false, + "mainClass": "net.minecraft.launchwrapper.Launch", + "jvmArgs": [ "-Dfml.ignorePatchDiscrepancies=true", "-Dfml.ignoreInvalidMinecraftCertificates=true", - - # Some options from Mojang's launcher "-XX:+UseConcMarkSweepGC", "-XX:+CMSIncrementalMode", "-XX:-UseAdaptiveSizePolicy", "-Xmn128M", - - # JVM Attach protection "-XX:+DisableAttachMechanism" -]; -clientArgs: [ + ], + "classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"], + "clientArgs": [ "--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker", "--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker" -]; + ], + "whitelist": [] +} \ No newline at end of file diff --git a/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.7.10.cfg b/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.7.10.cfg index dfd0d6e0..69ed799e 100644 --- a/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.7.10.cfg +++ b/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/profile1.7.10.cfg @@ -1,54 +1,37 @@ -version: "1.7.10"; -assetIndex: "1.7.10"; # 1.7.10+ only - -# Runtime-dependent params -dir: "XXXXX"; -assetDir: "asset1.7.10"; - -# Client params -sortIndex: 0; -title: "XXXXX"; -serverAddress: "server.tld"; -serverPort: 25565; - -# Updater and client watch service -updateFastCheck: true; -update: [ - "servers.dat" -]; -updateVerify: [ - "libraries", "natives", "mods", - "minecraft.jar", "forge.jar", "liteloader.jar" -]; -updateExclusions: [ - # "mods/carpentersblocks", - # "mods/ic2", - # "mods/railcraft" -]; -updateShared: []; -updateOptional: []; -enabledOptional: []; - -useWhitelist: false; -whitelist: []; - -# Client launcher params -mainClass: "net.minecraft.launchwrapper.Launch"; -classPath: [ "forge.jar", "liteloader.jar", "minecraft.jar", "libraries" ]; -jvmArgs: [ +{ + "version": "1.7.10", + "assetIndex": "1.7.10", + "assetDir": "asset1.7.10", + "dir": "xxxxxxx", + "sortIndex": 0, + "title": "Test1.7.10", + "serverAddress": "localhost", + "serverPort": 25565, + "update": ["servers.dat"], + "updateExclusions": [], + "updateShared": [], + "updateVerify": [ + "libraries", "natives", "mods", + "minecraft.jar", "forge.jar", "liteloader.jar" + ], + "updateOptional": [ + ], + "updateFastCheck": true, + "useWhitelist": false, + "mainClass": "net.minecraft.launchwrapper.Launch", + "jvmArgs": [ "-Dfml.ignorePatchDiscrepancies=true", "-Dfml.ignoreInvalidMinecraftCertificates=true", - - # Some options from Mojang's launcher "-XX:+UseConcMarkSweepGC", "-XX:+CMSIncrementalMode", "-XX:-UseAdaptiveSizePolicy", "-Xmn128M", - - # JVM Attach protection "-XX:+DisableAttachMechanism" -]; -clientArgs: [ + ], + "classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"], + "clientArgs": [ "--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker", "--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker" -]; + ], + "whitelist": [] +} \ No newline at end of file diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java index 2d3d090b..a430c815 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java @@ -179,6 +179,10 @@ public String[] getClientArgs() { public String getDir() { return dir; } + + public void setDir(String dir) { + this.dir = dir; + } @LauncherAPI public String getAssetDir() { return assetDir;