public BasicGame(Bot bot, NetUser creator, string name, string channelPrefix) { this.name = name; this.creator = creator; this.bot = bot; this.channel = Bot.Master.GetChannel("#" + channelPrefix + name); this.channel.Joined += new EventHandler<UserEventArgs>(OnJoin); this.channel.Left += new EventHandler<UserEventArgs>(OnLeft); }
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; }
public GameManager(Bot bot) { this.bot = bot; }