package com.techcavern.wavetact;

import com.techcavern.wavetact.Queues.MessageQueue;
import com.techcavern.wavetact.console.ConsoleClient;
import com.techcavern.wavetact.Queues.BanQueue;
import com.techcavern.wavetact.utils.ConfigUtils;
import com.techcavern.wavetact.utils.LoadUtils;
import com.techcavern.wavetact.utils.Registry;
import org.slf4j.impl.SimpleLogger;

import java.util.concurrent.TimeUnit;

@SuppressWarnings("ConstantConditions")
public class Main {

    public static void main(String[] args) throws Exception {
        System.err.println("");
        System.err.println("Welcome to WaveTact!");
        System.err.println("");

        System.setProperty(SimpleLogger.SHOW_DATE_TIME_KEY, "true");
        System.setProperty(SimpleLogger.DATE_TIME_FORMAT_KEY, "[yyyy/MM/dd HH:mm:ss]");
        System.setProperty(SimpleLogger.LEVEL_IN_BRACKETS_KEY, "true");
        LoadUtils.unpackNatives();
        if ((args.length >= 1) && args[0].equalsIgnoreCase("client")) {
            ConsoleClient.go();
        } else {
            LoadUtils.initiateDatabaseConnection();
            ConfigUtils.registerNetworks();
            LoadUtils.registerConsoleCommands();
            LoadUtils.registerIRCCommands();
            LoadUtils.registerAttacks();
            LoadUtils.registerEightball();
            Registry.WaveTact.start();
            Registry.threadPool.execute(Registry.consoleServer);
            Registry.threadPool.execute(new BanQueue());
            Registry.threadPool.execute(new MessageQueue());
            Registry.threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
        }
    }
}

@@ -363,16 +363,37 @@
 ogger;%0A%0A
+import java.io.File;%0A
 import j
@@ -578,92 +578,32 @@
 ln(%22
-%22);%0A        System.err.println(%22Welcome to WaveTact!%22);%0A        System.err.println(%22
+%5CnWelcome to WaveTact!%5Cn
 %22);%0A
@@ -986,16 +986,164 @@
  %7D else 
+if(new File(%22./console.unixsocket%22).exists())%7B%0A            System.err.println(%22Instance already started%22);%0A            System.exit(0);%0A        %7Delse
 %7B%0A      

Add check to prevent starting a second instance