static void Main(string[] args) { //while (true) { try { Bot bot = new Bot("config.xml"); bot.Run(); bot.Shutdown(); System.Threading.Thread.Sleep(1000); } catch(Exception ex) { Log.Fatal("Exception in main loop: " + ex.ToString()); } //} }
private void PopulateTestList() { allowCheck = true; DirectoryInfo dir = new DirectoryInfo("input"); foreach(FileInfo file in dir.GetFiles("*.txt")) { Bot bot = new Bot("config.xml", new MafiaBotV2.Network.File.FileMaster("input/" + file.Name, "actual/" + file.Name)); bot.Run(); bot.Shutdown(); bool same = false; try { if (File.ReadAllText("actual/" + file.Name) == File.ReadAllText("expected/" + file.Name)) { same = true; } } catch (FileNotFoundException ex) { } testList.Items.Add(file.Name, same); } allowCheck = false; }