Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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());
         }
     //}
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public GameManager(Bot bot)
 {
     this.bot = bot;
 }