From 6939de370f1be113516d81fc6be14a4db64935ee Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Sat, 27 Oct 2018 13:42:03 +0800 Subject: [PATCH] safe boot Former-commit-id: 9ee979f74853f3c61dfa34d9a0decf050c155233 --- .../org/maxgamer/quickshop/QuickShop.java | 22 ++++--------------- src/main/resources/config.yml | 3 +++ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index f073f12e7..735e0e81b 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -133,24 +133,10 @@ public class QuickShop extends JavaPlugin { getLogger().severe("WARNING: You are running QSRR unstable test version"); getLogger().severe("WARNING: Keep backup and DO NOT running on production environment!"); getLogger().severe("WARNING: Test version may destory anything!"); - getLogger().severe("WARNING: QSRR will start after you confirm, nothing will changes before this alert"); - getLogger().severe("WARNING: Input `qs continue` and press enter to continue load server."); - while(true) { - Scanner s = new Scanner(System.in); - String input = s.nextLine(); - switch (input) { - case "qs continue": - getLogger().severe("Continue..."); - break; - case "qs shutdown": - //Force stop server - getLogger().severe("Force shutting down..."); - System.exit(0); - break; - default: - getLogger().severe("Use `qs continue` to continue load or use `qs shutdown` to force shutdown without changes."); - break; - } + getLogger().severe("WARNING: QSRR won't start after you confirm, nothing will changes before you turn on dev allowed."); + if(!getConfig().getBoolean("dev-mode")){ + getLogger().severe("WARNING: Set dev-mode: true in config.yml to allow qs load on dev mode(Maybe need add this line by your self)."); + System.exit(0); } } getLogger().info("Quickshop Reremake by Ghost_chu(Minecraft SunnySide Server Community)"); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d0267c737..6eef7e251 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -3,6 +3,9 @@ #Do not touch if you not clear know about this config-version: 5 +#Do not touch if you not know what is this +dev-mode: false + #Tax amount (decimal) - Eg, P1 buys $50 worth of stuff from P2. Therefore, P1 loses $50, P2 gains $(1-0.05)*50, and tax-account gains $(0.05)*50. tax: 0.05