From 09ee2f5f05d8e02682248c0d31e3381ce841eb42 Mon Sep 17 00:00:00 2001 From: sasha0552 Date: Sat, 31 Aug 2019 04:19:39 +0600 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=92=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B7=D0=B0=D0=BF=D1=80?= =?UTF-8?q?=D0=B5=D1=89=D0=B0=D1=82=D1=8C=20=D0=BB=D0=B0=D1=83=D0=BD=D1=87?= =?UTF-8?q?=D0=B5=D1=80=D1=83=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D1=85=20OS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Launcher/runtime/config.js | 6 ++++++ Launcher/runtime/init.js | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Launcher/runtime/config.js b/Launcher/runtime/config.js index 28f92dba..a38ae38f 100644 --- a/Launcher/runtime/config.js +++ b/Launcher/runtime/config.js @@ -25,6 +25,12 @@ var config = { jvmMustdie64Dir: "jre-8u211-win64", // Название папки JVM для Windows x64 }, + allowedOS: { + windows: true, + linux: true, + mac: true + }, + settingsMagic: 0xC0DE5, // Магия вне хогвартса }; diff --git a/Launcher/runtime/init.js b/Launcher/runtime/init.js index b3d9a949..c3f6dae0 100644 --- a/Launcher/runtime/init.js +++ b/Launcher/runtime/init.js @@ -80,6 +80,24 @@ function setRootParent(parent) { } function start(args) { + if (!config.allowedOS.windows) { + if (JVMHelper.OS_TYPE == JVMHelperOS.MUSTDIE) { + LogHelper.info("This OS is not allowed!"); + return; + } + } + if (!config.allowedOS.linux) { + if (JVMHelper.OS_TYPE == JVMHelperOS.LINUX) { + LogHelper.info("This OS is not allowed!"); + return; + } + } + if (!config.allowedOS.mac) { + if (JVMHelper.OS_TYPE == JVMHelperOS.MACOSX) { + LogHelper.info("This OS is not allowed!"); + return; + } + } if (config.jvm.enable) { switch (JVMHelper.OS_TYPE) {