Ejemplo n.º 1
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        internal static void Initialize()
        {
            while (true)
            {
                Console.Write("[*] > ");

                string Input = Console.ReadLine();

                if (!string.IsNullOrEmpty(Input))
                {
                    string[] Args = Input.Trim().Split(' ');

                    if (Args[0] == "clear")
                    {
                        Console.Clear();
                    }
                    else if (Args[0] == "exit")
                    {
                        ExitHandler.Run(Args);
                    }
                    else if (Args[0] == "player")
                    {
                        PlayerHandler.Handle(Args);
                    }
                    else if (Args[0] == "clan")
                    {
                        ClanHandler.Handle(Args);
                    }
                    else if (Args[0] == "bot")
                    {
                        new Device();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when the cancel key has been pressed.
        /// </summary>
        /// <param name="Sender">The sender.</param>
        /// <param name="ConsoleCancelEventArgs">The <see cref="ConsoleCancelEventArgs"/> instance containing the event data.</param>
        private static void ConsoleOnCancelKeyPress(object Sender, ConsoleCancelEventArgs ConsoleCancelEventArgs)
        {
            ConsoleCancelEventArgs.Cancel = true;

            if (Program.Initialized == false)
            {
                Environment.Exit(0);
            }
            else
            {
                ExitHandler.Run("exit", "-f");
            }
        }