From 9088f080967faa87f462f0aec9d069712d965a7e Mon Sep 17 00:00:00 2001 From: TheR00st3r Date: Fri, 17 Nov 2023 01:12:25 +0100 Subject: [PATCH] Async Finalize --- PugSharp.Match/Match.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PugSharp.Match/Match.cs b/PugSharp.Match/Match.cs index 246e9ef8..6581c78a 100644 --- a/PugSharp.Match/Match.cs +++ b/PugSharp.Match/Match.cs @@ -488,7 +488,7 @@ private async Task CompleteMatchAsync() } var seriesResultParams = new SeriesResultParams(MatchInfo.Config.MatchId, MatchInfo.MatchMaps.GroupBy(x => x.Winner).MaxBy(x => x.Count())!.Key!.TeamConfig.Name, Forfeit: true, (uint)delay * 1100, MatchInfo.MatchMaps.Count(x => x.Team1Points > x.Team2Points), MatchInfo.MatchMaps.Count(x => x.Team2Points > x.Team1Points)); - await _ApiProvider.FinalizeAsync(seriesResultParams, CancellationToken.None).ConfigureAwait(false); + var finalize = _ApiProvider.FinalizeAsync(seriesResultParams, CancellationToken.None); while (delay > 0) { @@ -498,6 +498,8 @@ private async Task CompleteMatchAsync() delay -= delayLoopTime; } + await finalize.ConfigureAwait(false); + if (_DemoUploader != null) { await _DemoUploader.UploadDemoAsync(MatchInfo.DemoFile, CancellationToken.None).ConfigureAwait(false);