Skip to content

Commit

Permalink
Async Finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
TheR00st3r committed Nov 17, 2023
1 parent 915f4df commit 9088f08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PugSharp.Match/Match.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit 9088f08

Please sign in to comment.