Only stop IdentServer when it has successfully started. #45

This commit is contained in:
cnaude 2020-01-26 10:41:16 -07:00
parent d63bb01940
commit 70d037e450

View File

@ -128,6 +128,7 @@ public class PurpleIRC extends JavaPlugin {
private File configFile; private File configFile;
public static long startTime; public static long startTime;
public boolean identServerEnabled; public boolean identServerEnabled;
public boolean identServerStarted = false;
private boolean autoSave; private boolean autoSave;
public boolean pingFixTemplate; public boolean pingFixTemplate;
private final CaseInsensitiveMap<HashMap<String, String>> messageTmpl; private final CaseInsensitiveMap<HashMap<String, String>> messageTmpl;
@ -316,6 +317,7 @@ public class PurpleIRC extends JavaPlugin {
logInfo("Starting Ident Server ..."); logInfo("Starting Ident Server ...");
try { try {
IdentServer.startServer(); IdentServer.startServer();
identServerStarted = true;
} catch (Exception ex) { } catch (Exception ex) {
logError(ex.getMessage()); logError(ex.getMessage());
} }
@ -418,7 +420,7 @@ public class PurpleIRC extends JavaPlugin {
} }
ircBots.clear(); ircBots.clear();
} }
if (identServerEnabled) { if (identServerEnabled && identServerStarted) {
logInfo("Stopping Ident Server"); logInfo("Stopping Ident Server");
try { try {
IdentServer.stopServer(); IdentServer.stopServer();