コード例 #1
0
ファイル: Program.cs プロジェクト: Gurten/HaloOnlineTagTool
        private static bool ExecuteCommand(CommandContext context, List<string> commandAndArgs)
        {
            if (commandAndArgs.Count == 0)
                return true;

            // Look up the command
            var command = context.GetCommand(commandAndArgs[0]);
            if (command == null)
                return false;

            // Execute it
            commandAndArgs.RemoveAt(0);

            try
            {
                ExecuteCommand(command, commandAndArgs);
            }
            catch (Exception e)
            {
                Console.WriteLine("ERROR: " + e.Message);
                ConsoleHistory.Dump("hott_*_crash.log");
            }

            return true;
        }
コード例 #2
0
        private static bool ExecuteCommand(CommandContext context, List<string> commandAndArgs)
        {
            if (commandAndArgs.Count == 0)
                return true;

            // Look up the command
            var command = context.GetCommand(commandAndArgs[0]);
            if (command == null)
                return false;

            // Execute it
            commandAndArgs.RemoveAt(0);
            try
            {
                ExecuteCommand(command, commandAndArgs);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.ToString());
            }
            return true;
        }