예제 #1
0
        public static void Main(string[] args)
        {
            // Try - Catch erlaubt uns ein besseres Fehlermanagement, also nutzen wir das.
            try
            {
                // Lade die Konfiguration
                settings = SettingsParser <BotSettings> .Load();

                connection = SettingsParser <ConnectionSettings> .Load();

                // Logging starten
                Logging.InitLogging();

                // Exit-Methode registrieren
                AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnConsoleExit);

                // Log
                Console.Title = "TS³ Management Bot - " + Utility.Version.GetVersion();
                Logging.LogSpecial("Hallo, ich bin ein TeamSpeak³-Bot.");

                // Verbindung zum Server herstellen
                worker = TS3Worker.CreateWorker(connection);
                worker.OpenConnection();

                // Status
                isRunning = true;

                // Kommandos
                cmdThread = new Thread(CommandHandler.CheckCommands);
                cmdThread.Start();

                // BotLogic
                botThread = new Thread(TS3Worker.CheckLogic);
                botThread.Start();

                // Den Prozess nicht hier beenden
                while (true)
                {
                    continue;
                }
            }
            catch (Exception e)
            {
                // Logge die Exception
                Logging.LogException(e);
            }
        }
예제 #2
0
 public static void LoadSettings()
 {
     settingsParser.Load();
 }