[FEATURE] ClientProfile compat flags, remove deprecated

This commit is contained in:
Gravita 2023-02-26 18:00:44 +07:00
parent 43ffacdf5e
commit 0818b3037c
28 changed files with 54 additions and 858 deletions

View file

@ -219,7 +219,14 @@ public void reload(ReloadType type) throws Exception {
});
logger.debug("Init components successful");
}
if(!type.equals(ReloadType.NO_AUTH)) {
nettyServerSocketHandler.nettyServer.service.forEachActiveChannels((channel, wsHandler) -> {
Client client = wsHandler.getClient();
if(client.auth != null) {
client.auth = config.getAuthProviderPair(client.auth_id);
}
});
}
}
@Override
@ -236,7 +243,7 @@ public void invoke(String... args) throws Exception {
case "full" -> reload(ReloadType.FULL);
case "no_auth" -> reload(ReloadType.NO_AUTH);
case "no_components" -> reload(ReloadType.NO_COMPONENTS);
default -> reload(ReloadType.FULL);
default -> reload(ReloadType.NO_AUTH);
}
}
};

View file

@ -1,4 +1,4 @@
{
"features": [],
"features": ["profiles-rework"],
"info": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.10.2",
"assetIndex": "1.10.2",
"assetDir": "asset1.10",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.11.2",
"assetIndex": "1.11.2",
"assetDir": "asset1.11",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.12.2",
"assetIndex": "1.12.2",
"assetDir": "asset1.12",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker",
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,45 +0,0 @@
{
"version": "1.13.1",
"assetIndex": "1.13.1",
"assetDir": "asset1.13.1",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": ["servers.dat"],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries", "natives", "mods",
"minecraft.jar", "forge.jar", "liteloader.jar"
],
"updateOptional": [
],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.client.main.Main",
"jvmArgs": [
"-Dfml.ignorePatchDiscrepancies=true",
"-Dfml.ignoreInvalidMinecraftCertificates=true",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,45 +0,0 @@
{
"version": "1.13",
"assetIndex": "1.13",
"assetDir": "asset1.13",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": ["servers.dat"],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries", "natives", "mods",
"minecraft.jar", "forge.jar", "liteloader.jar"
],
"updateOptional": [
],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.client.main.Main",
"jvmArgs": [
"-Dfml.ignorePatchDiscrepancies=true",
"-Dfml.ignoreInvalidMinecraftCertificates=true",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,44 +0,0 @@
{
"version": "1.14.4",
"assetIndex": "1.14.4",
"assetDir": "asset1.14.4",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": [
"servers.dat"
],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries",
"natives",
"minecraft.jar"
],
"updateOptional": [],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.client.main.Main",
"jvmArgs": [
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": [
"minecraft.jar",
"libraries"
],
"clientArgs": [],
"whitelist": []
}

View file

@ -1,44 +0,0 @@
{
"version": "1.15.1",
"assetIndex": "1.15.1",
"assetDir": "asset1.15.1",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": [
"servers.dat"
],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries",
"natives",
"minecraft.jar"
],
"updateOptional": [],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.client.main.Main",
"jvmArgs": [
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": [
"minecraft.jar",
"libraries"
],
"clientArgs": [],
"whitelist": []
}

View file

@ -1,44 +0,0 @@
{
"version": "1.15.2",
"assetIndex": "1.15.2",
"assetDir": "asset1.15.2",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": [
"servers.dat"
],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries",
"natives",
"minecraft.jar"
],
"updateOptional": [],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.client.main.Main",
"jvmArgs": [
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": [
"minecraft.jar",
"libraries"
],
"clientArgs": [],
"whitelist": []
}

View file

@ -1,44 +0,0 @@
{
"version": "1.16.1",
"assetIndex": "1.16.1",
"assetDir": "asset1.16.1",
"dir": "HiTech",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "xxxxxxxx",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": [
"servers.dat"
],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries",
"natives",
"minecraft.jar"
],
"updateOptional": [],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.client.main.Main",
"jvmArgs": [
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": [
"minecraft.jar",
"libraries"
],
"clientArgs": [],
"whitelist": []
}

View file

@ -1,44 +0,0 @@
{
"version": "1.4.7",
"assetIndex": "---",
"assetDir": "asset1.4.7",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.4.7",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": ["servers.dat"],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries", "natives", "mods",
"minecraft.jar"
],
"updateOptional": [
],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.launchwrapper.Launch",
"jvmArgs": [
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism",
"-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png",
"-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png"
],
"classPath": ["minecraft.jar", "libraries"],
"clientArgs": [],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,44 +0,0 @@
{
"version": "1.5.2",
"assetIndex": "---",
"assetDir": "asset1.5.2",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.5.2",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"update": ["servers.dat"],
"updateExclusions": [],
"updateShared": [],
"updateVerify": [
"libraries", "natives", "mods",
"minecraft.jar"
],
"updateOptional": [
],
"updateFastCheck": true,
"useWhitelist": false,
"mainClass": "net.minecraft.launchwrapper.Launch",
"jvmArgs": [
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism",
"-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png",
"-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png"
],
"classPath": ["minecraft.jar", "libraries"],
"clientArgs": [],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,49 +0,0 @@
{
"version": "1.6.4",
"assetIndex": "---",
"assetDir": "asset1.6.4",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.6.4",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism",
"-Dlauncher.legacy.skinsURL=http://skins.minecraft.net/MinecraftSkins/%username%.png",
"-Dlauncher.legacy.cloaksURL=http://skins.minecraft.net/MinecraftCloaks/%username%.png"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.7.10",
"assetIndex": "1.7.10",
"assetDir": "asset1.7.10",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.7.10",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.7.2",
"assetIndex": "1.7.2",
"assetDir": "asset1.7.2",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.7.2",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.8.9",
"assetIndex": "1.8.9",
"assetDir": "asset1.8.9",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.8.9",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -1,47 +0,0 @@
{
"version": "1.9.4",
"assetIndex": "1.9.4",
"assetDir": "asset1.9.4",
"dir": "xxxxxxx",
"info": "Информация о сервере",
"sortIndex": 0,
"title": "Test1.9.4",
"servers": [
{
"name": "----",
"serverAddress": "localhost",
"serverPort": 25565,
"isDefault": true
}
],
"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",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy",
"-Xmn128M",
"-XX:+DisableAttachMechanism"
],
"classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
],
"optionalJVMArgs": [],
"optionalClientArgs": [],
"optionalClassPath": [],
"whitelist": []
}

View file

@ -107,7 +107,6 @@ public static void main(String[] args) throws Throwable {
} else if (params.session != null) {
throw new UnsupportedOperationException("Legacy session not supported");
}
checkJVMBitsAndVersion(params.profile.getMinJavaVersion(), params.profile.getRecommendJavaVersion(), params.profile.getMaxJavaVersion(), params.profile.isWarnMissJavaVersion());
LauncherEngine.modulesManager.invokeEvent(new ClientProcessInitPhase(engine, params));
Path clientDir = Paths.get(params.clientDir);
@ -174,15 +173,6 @@ public static void main(String[] args) throws Throwable {
AuthService.username = params.playerProfile.username;
AuthService.uuid = params.playerProfile.uuid;
KeyService.serverRsaPublicKey = Launcher.getConfig().rsaPublicKey;
if (params.profile.getRuntimeInClientConfig() != ClientProfile.RuntimeInClientConfig.NONE) {
CommonHelper.newThread("Client Launcher Thread", true, () -> {
try {
engine.start(args);
} catch (Throwable throwable) {
LogHelper.error(throwable);
}
}).start();
}
LauncherEngine.modulesManager.invokeEvent(new ClientProcessReadyEvent(engine, params));
LogHelper.debug("Starting JVM and client WatchService");
FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher();
@ -268,28 +258,6 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher,
}
}
public static boolean checkJVMBitsAndVersion(int minVersion, int recommendVersion, int maxVersion, boolean showMessage) {
boolean ok = true;
if (JVMHelper.JVM_BITS == 64 && JVMHelper.ARCH_TYPE == JVMHelper.ARCH.X86) {
String error = "У Вас установлена Java x64, но Ваша система определена как x32. Установите Java правильной разрядности";
LogHelper.error(error);
if (showMessage)
JOptionPane.showMessageDialog(null, error);
ok = false;
}
String jvmVersion = JVMHelper.RUNTIME_MXBEAN.getVmVersion();
LogHelper.info(jvmVersion);
int version = JVMHelper.getVersion();
if (version < minVersion || version > maxVersion) {
String error = String.format("У Вас установлена Java %d, но этот клиент требует Java %d", JVMHelper.getVersion(), recommendVersion);
LogHelper.error(error);
if (showMessage)
JOptionPane.showMessageDialog(null, error);
ok = false;
}
return ok;
}
private static LinkedList<Path> resolveClassPathList(Path clientDir, String... classPath) throws IOException {
return resolveClassPathStream(clientDir, classPath).collect(Collectors.toCollection(LinkedList::new));
}
@ -353,7 +321,7 @@ private static void launch(ClientProfile profile, ClientLauncherProcess.ClientPa
List<String> compatClasses = profile.getCompatClasses();
for (String e : compatClasses) {
Class<?> clazz = classLoader.loadClass(e);
MethodHandle runMethod = MethodHandles.publicLookup().findStatic(clazz, "run", MethodType.methodType(void.class));
MethodHandle runMethod = MethodHandles.lookup().findStatic(clazz, "run", MethodType.methodType(void.class));
runMethod.invoke();
}
}

View file

@ -76,9 +76,14 @@ public ClientLauncherProcess(Path clientDir, Path assetDir, JavaHelper.JavaVersi
this.params.clientDir = this.workDir.toString();
this.params.resourcePackDir = resourcePackDir.toAbsolutePath().toString();
this.params.assetDir = assetDir.toAbsolutePath().toString();
Path nativesPath = workDir.resolve("natives").resolve(JVMHelper.OS_TYPE.name).resolve(javaVersion.arch.name);
if (!Files.isDirectory(nativesPath)) {
Path nativesPath;
if(profile.hasFlag(ClientProfile.CompatibilityFlags.LEGACY_NATIVES_DIR)) {
nativesPath = workDir.resolve("natives");
} else {
nativesPath = workDir.resolve("natives").resolve(JVMHelper.OS_TYPE.name).resolve(javaVersion.arch.name);
}
if (!Files.isDirectory(nativesPath)) {
throw new RuntimeException(String.format("Natives dir %s not exist! Your operating system or architecture not supported", nativesPath.toAbsolutePath()));
}
this.params.nativesDir = nativesPath.toString();
this.params.profile = profile;
@ -123,16 +128,6 @@ private void applyClientProfile() {
}
this.jvmModules.addAll(this.params.profile.getModules());
this.jvmModulesPaths.addAll(this.params.profile.getModulePath());
if (this.params.profile.getRuntimeInClientConfig() != ClientProfile.RuntimeInClientConfig.NONE) {
jvmModules.add("javafx.base");
jvmModules.add("javafx.graphics");
jvmModules.add("javafx.fxml");
jvmModules.add("javafx.controls");
jvmModules.add("javafx.swing");
jvmModules.add("javafx.media");
jvmModules.add("javafx.web");
}
LauncherEngine.modulesManager.invokeEvent(new ClientProcessBuilderCreateEvent(this));
}

View file

@ -62,13 +62,10 @@ public final class ClientProfile implements Comparable<ClientProfile> {
@LauncherNetworkAPI
private List<ServerProfile> servers;
@LauncherNetworkAPI
private SecurityManagerConfig securityManagerConfig;
@LauncherNetworkAPI
private ClassLoaderConfig classLoaderConfig;
@LauncherNetworkAPI
private SignedClientConfig signedClientConfig;
@LauncherNetworkAPI
private RuntimeInClientConfig runtimeInClientConfig;
private List<CompatibilityFlags> flags;
@LauncherNetworkAPI
private int recommendJavaVersion = 8;
@LauncherNetworkAPI
@ -76,8 +73,6 @@ public final class ClientProfile implements Comparable<ClientProfile> {
@LauncherNetworkAPI
private int maxJavaVersion = 999;
@LauncherNetworkAPI
private boolean warnMissJavaVersion = true;
@LauncherNetworkAPI
private ProfileDefaultSettings settings = new ProfileDefaultSettings();
@LauncherNetworkAPI
private boolean limited;
@ -99,13 +94,11 @@ public ClientProfile() {
compatClasses = new ArrayList<>();
properties = new HashMap<>();
servers = new ArrayList<>(1);
securityManagerConfig = SecurityManagerConfig.CLIENT;
classLoaderConfig = ClassLoaderConfig.LAUNCHER;
signedClientConfig = SignedClientConfig.NONE;
runtimeInClientConfig = RuntimeInClientConfig.NONE;
flags = new ArrayList<>();
}
public ClientProfile(List<String> update, List<String> updateExclusions, List<String> updateShared, List<String> updateVerify, Set<OptionalFile> updateOptional, List<String> jvmArgs, List<String> classPath, List<String> modulePath, List<String> modules, List<String> altClassPath, List<String> clientArgs, List<String> compatClasses, Map<String, String> properties, List<ServerProfile> servers, SecurityManagerConfig securityManagerConfig, ClassLoaderConfig classLoaderConfig, SignedClientConfig signedClientConfig, RuntimeInClientConfig runtimeInClientConfig, String version, String assetIndex, String dir, String assetDir, int recommendJavaVersion, int minJavaVersion, int maxJavaVersion, boolean warnMissJavaVersion, ProfileDefaultSettings settings, int sortIndex, UUID uuid, String title, String info, String mainClass) {
public ClientProfile(List<String> update, List<String> updateExclusions, List<String> updateShared, List<String> updateVerify, Set<OptionalFile> updateOptional, List<String> jvmArgs, List<String> classPath, List<String> modulePath, List<String> modules, List<String> altClassPath, List<String> clientArgs, List<String> compatClasses, Map<String, String> properties, List<ServerProfile> servers, ClassLoaderConfig classLoaderConfig, List<CompatibilityFlags> flags, String version, String assetIndex, String dir, String assetDir, int recommendJavaVersion, int minJavaVersion, int maxJavaVersion, ProfileDefaultSettings settings, int sortIndex, UUID uuid, String title, String info, String mainClass) {
this.update = update;
this.updateExclusions = updateExclusions;
this.updateShared = updateShared;
@ -120,10 +113,7 @@ public ClientProfile(List<String> update, List<String> updateExclusions, List<St
this.compatClasses = compatClasses;
this.properties = properties;
this.servers = servers;
this.securityManagerConfig = securityManagerConfig;
this.classLoaderConfig = classLoaderConfig;
this.signedClientConfig = signedClientConfig;
this.runtimeInClientConfig = runtimeInClientConfig;
this.version = version;
this.assetIndex = assetIndex;
this.dir = dir;
@ -131,13 +121,13 @@ public ClientProfile(List<String> update, List<String> updateExclusions, List<St
this.recommendJavaVersion = recommendJavaVersion;
this.minJavaVersion = minJavaVersion;
this.maxJavaVersion = maxJavaVersion;
this.warnMissJavaVersion = warnMissJavaVersion;
this.settings = settings;
this.sortIndex = sortIndex;
this.uuid = uuid;
this.title = title;
this.info = info;
this.mainClass = mainClass;
this.flags = flags;
}
public ServerProfile getDefaultServerProfile() {
@ -245,10 +235,6 @@ public int getMaxJavaVersion() {
return maxJavaVersion;
}
public boolean isWarnMissJavaVersion() {
return warnMissJavaVersion;
}
public ProfileDefaultSettings getSettings() {
return settings;
}
@ -331,6 +317,10 @@ public void setUUID(UUID uuid) {
this.uuid = uuid;
}
public boolean hasFlag(CompatibilityFlags flag) {
return flags.contains(flag);
}
public void verify() {
// Version
getVersion();
@ -432,18 +422,14 @@ public void setClassLoaderConfig(ClassLoaderConfig classLoaderConfig) {
this.classLoaderConfig = classLoaderConfig;
}
public RuntimeInClientConfig getRuntimeInClientConfig() {
return runtimeInClientConfig;
}
public void setRuntimeInClientConfig(RuntimeInClientConfig runtimeInClientConfig) {
this.runtimeInClientConfig = runtimeInClientConfig;
}
public boolean isLimited() {
return limited;
}
public List<CompatibilityFlags> getFlags() {
return flags;
}
public enum Version {
MC125("1.2.5", 29),
MC147("1.4.7", 51),
@ -513,20 +499,12 @@ public String toString() {
}
}
public enum SecurityManagerConfig {
NONE, CLIENT, LAUNCHER, MIXED
}
public enum ClassLoaderConfig {
AGENT, LAUNCHER, MODULE, SYSTEM_ARGS
}
public enum SignedClientConfig {
NONE, SIGNED
}
public enum RuntimeInClientConfig {
NONE, BASIC, FULL
public enum CompatibilityFlags {
LEGACY_NATIVES_DIR
}
@FunctionalInterface

View file

@ -19,10 +19,8 @@ public class ClientProfileBuilder {
private List<String> compatClasses = new ArrayList<>();
private Map<String, String> properties = new HashMap<>();
private List<ClientProfile.ServerProfile> servers = new ArrayList<>();
private ClientProfile.SecurityManagerConfig securityManagerConfig = ClientProfile.SecurityManagerConfig.LAUNCHER;
private ClientProfile.ClassLoaderConfig classLoaderConfig = ClientProfile.ClassLoaderConfig.LAUNCHER;
private ClientProfile.SignedClientConfig signedClientConfig = ClientProfile.SignedClientConfig.NONE;
private ClientProfile.RuntimeInClientConfig runtimeInClientConfig = ClientProfile.RuntimeInClientConfig.NONE;
private List<ClientProfile.CompatibilityFlags> flags = new ArrayList<>();
private String version;
private String assetIndex;
private String dir;
@ -30,7 +28,6 @@ public class ClientProfileBuilder {
private int recommendJavaVersion = 8;
private int minJavaVersion = 8;
private int maxJavaVersion = 999;
private boolean warnMissJavaVersion = true;
private ClientProfile.ProfileDefaultSettings settings = new ClientProfile.ProfileDefaultSettings();
private int sortIndex;
private UUID uuid;
@ -98,26 +95,11 @@ public ClientProfileBuilder setServers(List<ClientProfile.ServerProfile> servers
return this;
}
public ClientProfileBuilder setSecurityManagerConfig(ClientProfile.SecurityManagerConfig securityManagerConfig) {
this.securityManagerConfig = securityManagerConfig;
return this;
}
public ClientProfileBuilder setClassLoaderConfig(ClientProfile.ClassLoaderConfig classLoaderConfig) {
this.classLoaderConfig = classLoaderConfig;
return this;
}
public ClientProfileBuilder setSignedClientConfig(ClientProfile.SignedClientConfig signedClientConfig) {
this.signedClientConfig = signedClientConfig;
return this;
}
public ClientProfileBuilder setRuntimeInClientConfig(ClientProfile.RuntimeInClientConfig runtimeInClientConfig) {
this.runtimeInClientConfig = runtimeInClientConfig;
return this;
}
public ClientProfileBuilder setVersion(String version) {
this.version = version;
return this;
@ -163,11 +145,6 @@ public ClientProfileBuilder setMaxJavaVersion(int maxJavaVersion) {
return this;
}
public ClientProfileBuilder setWarnMissJavaVersion(boolean warnMissJavaVersion) {
this.warnMissJavaVersion = warnMissJavaVersion;
return this;
}
public ClientProfileBuilder setSettings(ClientProfile.ProfileDefaultSettings settings) {
this.settings = settings;
return this;
@ -198,7 +175,12 @@ public ClientProfileBuilder setMainClass(String mainClass) {
return this;
}
public ClientProfileBuilder setFlags(List<ClientProfile.CompatibilityFlags> flags) {
this.flags = flags;
return this;
}
public ClientProfile createClientProfile() {
return new ClientProfile(update, updateExclusions, updateShared, updateVerify, updateOptional, jvmArgs, classPath, modulePath, modules, altClassPath, clientArgs, compatClasses, properties, servers, securityManagerConfig, classLoaderConfig, signedClientConfig, runtimeInClientConfig, version, assetIndex, dir, assetDir, recommendJavaVersion, minJavaVersion, maxJavaVersion, warnMissJavaVersion, settings, sortIndex, uuid, title, info, mainClass);
return new ClientProfile(update, updateExclusions, updateShared, updateVerify, updateOptional, jvmArgs, classPath, modulePath, modules, altClassPath, clientArgs, compatClasses, properties, servers, classLoaderConfig, flags, version, assetIndex, dir, assetDir, recommendJavaVersion, minJavaVersion, maxJavaVersion, settings, sortIndex, uuid, title, info, mainClass);
}
}

View file

@ -11,8 +11,6 @@ public final class PlayerProfile {
public final UUID uuid;
public final String username;
@Deprecated
public final Texture skin, cloak;
public final Map<String, Texture> assets;
public final Map<String, String> properties;
@ -26,8 +24,6 @@ public PlayerProfile(UUID uuid, String username, Texture skin, Texture cloak) {
public PlayerProfile(UUID uuid, String username, Texture skin, Texture cloak, Map<String, String> properties) {
this.uuid = Objects.requireNonNull(uuid, "uuid");
this.username = username;
this.skin = skin;
this.cloak = cloak;
this.assets = new HashMap<>();
if (skin != null) {
this.assets.put("SKIN", skin);
@ -43,8 +39,6 @@ public PlayerProfile(UUID uuid, String username, Map<String, Texture> assets, Ma
this.username = username;
this.assets = assets;
this.properties = properties;
this.skin = assets.get("SKIN");
this.cloak = assets.get("CAPE");
}
public static PlayerProfile newOfflineProfile(String username) {

View file

@ -28,6 +28,7 @@ public abstract class ClientWebSocketService extends ClientJSONPoint {
private static boolean resultsRegistered = false;
public final Gson gson;
public final Boolean onConnect;
public final Object waitObject = new Object();
public OnCloseCallback onCloseCallback;
public ReconnectCallback reconnectCallback;
@ -71,8 +72,8 @@ void onDisconnect() {
@Override
void onOpen() {
synchronized (onConnect) {
onConnect.notifyAll();
synchronized (waitObject) {
waitObject.notifyAll();
}
}
@ -80,7 +81,6 @@ public void registerRequests() {
}
@SuppressWarnings("deprecation")
public void registerResults() {
if (!resultsRegistered) {
results.register("auth", AuthRequestEvent.class);

View file

@ -51,13 +51,16 @@ public UniversalJsonAdapter(ProviderMap<R> providerMap, String name, String PROP
public R deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
String typename = json.getAsJsonObject().getAsJsonPrimitive(PROP_NAME).getAsString();
if(typename == null) {
throw new JsonParseException(String.format("%s: missing type property", name));
}
Class<? extends R> cls = providerMap.getClass(typename);
if (cls == null) {
//if (printErrorIfUnknownType) LogHelper.error("%s %s not found", name, typename);
if (defaultClass != null) {
return context.deserialize(json, defaultClass);
} else {
throw new JsonParseException(String.format("%s: type %s not registered", name, typename));
}
return null;
}
return context.deserialize(json, cls);
}
@ -72,6 +75,8 @@ public JsonElement serialize(R src, Type typeOfSrc, JsonSerializationContext con
}
if (classPath != null) {
jo.add(PROP_NAME, new JsonPrimitive(classPath));
} else {
throw new JsonParseException(String.format("Class %s not registered", src.getClass().getName()));
}
return jo;
}

View file

@ -5,10 +5,10 @@
public final class Version implements Comparable<Version> {
public static final int MAJOR = 5;
public static final int MINOR = 3;
public static final int PATCH = 6;
public static final int MINOR = 4;
public static final int PATCH = 0;
public static final int BUILD = 1;
public static final Version.Type RELEASE = Type.DEV;
public static final Version.Type RELEASE = Type.EXPERIMENTAL;
public final int major;
public final int minor;
public final int patch;

View file

@ -26,7 +26,6 @@ public final class JVMHelper {
public static final String OS_VERSION = OPERATING_SYSTEM_MXBEAN.getVersion();
public static final ARCH ARCH_TYPE = getArch(System.getProperty("os.arch"));
public static final int JVM_BITS = Integer.parseInt(System.getProperty("sun.arch.data.model"));
public static final SecurityManager SECURITY_MANAGER = System.getSecurityManager();
// Public static fields
public static final Runtime RUNTIME = Runtime.getRuntime();
public static final ClassLoader LOADER = ClassLoader.getSystemClassLoader();

@ -1 +1 @@
Subproject commit 1f34a8f8bcb6399469da0e27e8d3e7e3a20d3e00
Subproject commit 2ea978f02d44893b7f02ae63eac3d3a07a1e0e11