From cbeb2215382907852e937309b221b51f42f79e8a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 22 Jun 2021 21:00:28 +0200 Subject: [PATCH 1/3] Add Nodename to Startup --- SpigotCore_Main/src/de/steamwar/core/Core.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SpigotCore_Main/src/de/steamwar/core/Core.java b/SpigotCore_Main/src/de/steamwar/core/Core.java index 62f8849..c5c52ef 100644 --- a/SpigotCore_Main/src/de/steamwar/core/Core.java +++ b/SpigotCore_Main/src/de/steamwar/core/Core.java @@ -29,6 +29,11 @@ import de.steamwar.sql.SQL; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.logging.Level; + public class Core extends JavaPlugin{ private static Core instance; @@ -52,6 +57,11 @@ public class Core extends JavaPlugin{ @Override public void onLoad() { + try { + Bukkit.getLogger().log(Level.INFO, "Node Name: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine()); + } catch (IOException e) { + e.printStackTrace(); + } setInstance(this); } -- 2.39.5 From cf961c88f53ac8a4a2ed5d4079a3b1bab9d0896f Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 26 Jun 2021 11:23:22 +0200 Subject: [PATCH 2/3] Changing Things around --- SpigotCore_Main/src/de/steamwar/core/Core.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/core/Core.java b/SpigotCore_Main/src/de/steamwar/core/Core.java index c5c52ef..53a7fcf 100644 --- a/SpigotCore_Main/src/de/steamwar/core/Core.java +++ b/SpigotCore_Main/src/de/steamwar/core/Core.java @@ -57,11 +57,6 @@ public class Core extends JavaPlugin{ @Override public void onLoad() { - try { - Bukkit.getLogger().log(Level.INFO, "Node Name: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine()); - } catch (IOException e) { - e.printStackTrace(); - } setInstance(this); } @@ -71,11 +66,16 @@ public class Core extends JavaPlugin{ Bukkit.getPluginManager().registerEvents(new ChattingEvent(), this); Bukkit.getPluginManager().registerEvents(new WorldLoadEvent(), this); ChunkListener.init(); - if(version >= 12) + if (version >= 12) ErrorLogger.init(); getServer().getMessenger().registerIncomingPluginChannel(this, "sw:bridge", new BungeeReceiver()); getServer().getMessenger().registerOutgoingPluginChannel(this, "sw:bridge"); AuthlibInjector.inject(); + try { + Bukkit.getLogger().log(Level.INFO, "Running on: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine()); + } catch (IOException e) { + e.printStackTrace(); + } } @Override -- 2.39.5 From a6cf3be5f012b13b9c7386226f67b3c4b8db8faf Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 11 Sep 2021 13:13:28 +0200 Subject: [PATCH 3/3] Fix error Handleing --- SpigotCore_Main/src/de/steamwar/core/Core.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/core/Core.java b/SpigotCore_Main/src/de/steamwar/core/Core.java index 53a7fcf..984a8ab 100644 --- a/SpigotCore_Main/src/de/steamwar/core/Core.java +++ b/SpigotCore_Main/src/de/steamwar/core/Core.java @@ -74,7 +74,7 @@ public class Core extends JavaPlugin{ try { Bukkit.getLogger().log(Level.INFO, "Running on: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine()); } catch (IOException e) { - e.printStackTrace(); + throw new SecurityException("Could not load Hostname", e); } } -- 2.39.5