Skip to content

Commit

Permalink
added safe startup option+ catch around init
Browse files Browse the repository at this point in the history
  • Loading branch information
dries007 committed Aug 16, 2016
1 parent e9daa45 commit 47bcf47
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/net/doubledoordev/backend/Main.java
Expand Up @@ -59,6 +59,7 @@ public class Main
public static String adminKey;
public static boolean running = true;
public static boolean debug = false;
public static boolean safe = false;

static
{
Expand Down Expand Up @@ -111,6 +112,7 @@ public static void main(String[] args) throws Exception
for (String arg : args)
{
if (arg.equalsIgnoreCase("debug")) debug = true;
if (arg.equalsIgnoreCase("safe")) safe = true;
}

// todo: get JDK and classload tools.jar + native library; if not jdk: disable warmroast
Expand Down Expand Up @@ -178,17 +180,15 @@ public static void main(String[] args) throws Exception
CommandHandler.init();
for (Server server : SETTINGS.servers.values())
{
server.init();
if (server.getRestartingInfo().autoStart)
try
{
try
{
server.startServer();
}
catch (Exception ignored)
{
ignored.printStackTrace();
}
server.init();
if (!safe && server.getRestartingInfo().autoStart) server.startServer();
}
catch (Exception ignored)
{
LOGGER.catching(ignored);
ignored.printStackTrace();
}
}
}
Expand Down

0 comments on commit 47bcf47

Please sign in to comment.