示例#1
0
        public async Task RunAsync()
        {
            try
            {
                while (!tokenProvider.Token.IsCancellationRequested)
                {
                    StormReplay?stormReplay = await provider.TryLoadReplayAsync();

                    if (stormReplay != null)
                    {
                        logger.LogInformation("Loaded: " + stormReplay.Path);

                        await writer.WriteDetailsAsync(stormReplay);

                        await runner.ReplayAsync(stormReplay);
                    }
                }
            }
            catch (Exception e)
            {
                logger.LogError(e, "There was an error in the replay consumer.");
            }
            finally
            {
            }
        }
示例#2
0
        public async Task RunAsync()
        {
            try
            {
                await gameData.LoadDataAsync();

                while (!tokenProvider.Token.IsCancellationRequested)
                {
                    StormReplay?stormReplay = await replayProvider.TryLoadReplayAsync();

                    if (stormReplay != null)
                    {
                        await gameManager.SetSessionAsync(stormReplay);

                        await gameManager.SpectateSessionAsync();
                    }
                }
            }
            catch (Exception e)
            {
                logger.LogError(e, "There was an error in the replay consumer.");
            }
        }