From 851dcf52fe66c73225b7207cfa61ab50d171dba2 Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Thu, 17 Jan 2019 19:01:07 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20Logger=20=D0=B8=20ServerWrapper=20?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20e.printStackTrace=20=D0=B2=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=BE=20=D0=BD=D0=BE=D1=80=D0=BC=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BB=D0=BE=D0=B3=D0=B3=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/gravit/launcher/server/ServerAgent.java | 6 +++--- .../main/java/ru/gravit/launcher/server/ServerWrapper.java | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java index 8727ca82..607cca82 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java @@ -63,16 +63,16 @@ public static void premain(String agentArgument, Instrumentation instrumentation Object[] args = {agentArgument, instrumentation}; mainMethod.invoke(args); } catch (Throwable e) { - e.printStackTrace(); + LogHelper.error(e); } } } public static void loadLibraries(Path dir) { try { - Files.walkFileTree(dir, Collections.singleton(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new StarterVisitor()); + IOHelper.walk(dir, new StarterVisitor(), true); } catch (IOException e) { - e.printStackTrace(System.err); + LogHelper.error(e); } } } diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index d46e36cf..8ee17b3d 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -77,6 +77,8 @@ public static boolean loopAuth(ServerWrapper wrapper, int count, int sleeptime) try { Thread.sleep(sleeptime); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LogHelper.error(e); return false; } } @@ -179,10 +181,6 @@ private static void generateConfigIfNotExists() throws IOException { newConfig.reconnectCount = 10; newConfig.reconnectSleep = 1000; newConfig.env = LauncherConfig.LauncherEnvironment.STD; - //try(Reader reader = IOHelper.newReader(IOHelper.getResourceURL("ru/gravit/launcher/server/ServerWrapper.cfg"))) - //{ - // newConfig = gson.fromJson(reader,Config.class); - //} LogHelper.warning("Title is not set. Please show ServerWrapper.cfg");