Esempio n. 1
0
        static void Main(string[] args)
        {
            Win32.SetConsoleCtrlHandler(HandleCtrl, true);

            ArgumentsParser parsedArgs = new ArgumentsParser(args);

            if (parsedArgs.Error != ArgsError.NoError)
            {
                ShowError(parsedArgs);
                return;
            }

            Console.WriteLine("Starting bots...");

            try
            {
                using (f = new BotFramework(new BotConsoleOutputHandler(), parsedArgs))
                {
                    f.Initialize(new PartyBotFactory(), parsedArgs.InitDelay);
                    f.Run(parsedArgs.WaitForTermination);
                    f.WaitForBotsToComplete();
                }

                Console.WriteLine("All bots completed.");
            }
            catch (BotException bex)
            {
                Console.WriteLine(bex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("\nUnhandled error: {0}", ex.Message);
            }
        }
Esempio n. 2
0
		static void Main(string[] args)
		{
			Win32.SetConsoleCtrlHandler(HandleCtrl, true);

			ArgumentsParser parsedArgs = new ArgumentsParser(args);

			if (parsedArgs.Error != ArgsError.NoError)
			{
				ShowError(parsedArgs);
				return;
			}

			Console.WriteLine("Starting bots...");

			try
			{
				using (f = new BotFramework(new BotConsoleOutputHandler(), parsedArgs))
				{
					f.Initialize(new PartyBotFactory(), parsedArgs.InitDelay);
					f.Run(parsedArgs.WaitForTermination);
					f.WaitForBotsToComplete();
				}

				Console.WriteLine("All bots completed.");
			}
			catch (BotException bex)
			{
				Console.WriteLine(bex.Message);
			}
			catch (Exception ex)
			{
				Console.WriteLine("\nUnhandled error: {0}", ex.Message);
			}
		}