From cb279a5d5a3eee344e0b713412c16c588c907653 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 10 May 2022 11:56:06 -0400 Subject: [PATCH] bugfix: Pass MB_WORLD_PORT to isPortInUse() --- src/discord/MagicBot.java | 17 ----------------- src/discord/handlers/StatusRequestHandler.java | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/discord/MagicBot.java b/src/discord/MagicBot.java index 55df1ee7..b74cc2a8 100644 --- a/src/discord/MagicBot.java +++ b/src/discord/MagicBot.java @@ -89,23 +89,6 @@ public class MagicBot extends ListenerAdapter { return; } - if (ConfigManager.MB_PUBLIC_ADDR.getValue().equals("0.0.0.0")) { - - // Autoconfigure IP address for use in worldserver response - // . - Logger.info("AUTOCONFIG PUBLIC IP ADDRESS"); - URL whatismyip = null; - - try { - whatismyip = new URL("http://checkip.amazonaws.com"); - BufferedReader in = null; - in = new BufferedReader(new InputStreamReader(whatismyip.openStream())); - ConfigManager.MB_PUBLIC_ADDR.setValue(in.readLine()); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - // Configure Discord essential identifiers discordServerID = Long.parseLong(ConfigManager.MB_MAGICBOT_SERVERID.getValue()); diff --git a/src/discord/handlers/StatusRequestHandler.java b/src/discord/handlers/StatusRequestHandler.java index 39e59985..7f173d9d 100644 --- a/src/discord/handlers/StatusRequestHandler.java +++ b/src/discord/handlers/StatusRequestHandler.java @@ -27,8 +27,8 @@ public class StatusRequestHandler { // Add server status info outString += "\nServer Status: "; - if (LoginServer.isPortInUse(Integer.parseInt(ConfigManager.MB_BIND_ADDR.getValue()))) - outString += "ONLINE\n"; + if (LoginServer.isPortInUse(Integer.parseInt(ConfigManager.MB_WORLD_PORT.getValue()))) + outString += "ONLINE\n"; else outString += "OFFLINE\n";