Пример #1
0
        public override async System.Threading.Tasks.Task DoAction()
        {
            await base.DoAction();

            await CommandContext.TriggerTypingAsync();

            try
            {
                var tcaFileManager =
                    new TcaFileManager(CommandContext, Authentication, Authentication.Service.RootDirectory);
                await tcaFileManager.InitializeFileManagerAsync();
            }
            catch (Exception e)
            {
                await CommandContext.RespondAsync(
                    "**An error occurred when using the File Manager**");

                await CommandContext.RespondAsync(e.Message);

                await CommandContext.RespondAsync(e.StackTrace);

                await CommandContext.RespondAsync("EWGAWSG");

                await CommandContext.RespondAsync(e.InnerException.Message);

                await CommandContext.RespondAsync(e.InnerException.StackTrace);

                throw;
            }
        }
        public override async Task DoAction()
        {
            await base.DoAction();

            await CommandContext.TriggerTypingAsync();

            var game = new TCAdmin.GameHosting.SDK.Objects.Game(Authentication.Service.GameId);

            if (!game.WebConsole.EnableWebConsole || string.IsNullOrEmpty(game.WebConsole.LogFile))
            {
                await CommandContext.RespondAsync("**This game does not support Log Viewing.**");

                return;
            }

            try
            {
                var logFileDirectory = Path.GetDirectoryName(game.WebConsole.LogFile);
                var tcaFileManager   = new TcaFileManager(CommandContext, Authentication,
                                                          Authentication.Service.RootDirectory + "\\" + logFileDirectory, true);
                await tcaFileManager.InitializeFileManagerAsync();
            }
            catch (ArgumentException)
            {
                await CommandContext.RespondAsync("**The path for the logs contains too many files to show.");
            }
            catch (Exception ex)
            {
                var id = SentrySdk.CaptureException(ex);
                await CommandContext.RespondAsync(
                    $"**An error occurred when using the File Manager\nSentry ID: {id}.**");
            }
        }
Пример #3
0
        public override async Task DoAction()
        {
            await base.DoAction();

            await CommandContext.TriggerTypingAsync();

            try
            {
                var tcaFileManager =
                    new TcaFileManager(CommandContext, Authentication, Authentication.Service.RootDirectory);
                await tcaFileManager.InitializeFileManagerAsync();
            }
            catch (Exception ex)
            {
                var id = SentrySdk.CaptureException(ex);
                await CommandContext.RespondAsync(
                    $"**An error occurred when using the File Manager\nSentry ID: {id}.**");
            }
        }